Книги и журналы » Компьютерная литература » Программирование (книги)
Django Design Patterns and Best PracticesГод: 2015
Автор: Arun Ravindran
Издательство: Packt Publishing
ISBN: 9781783986644
Язык: Английский
Формат: PDF
Качество: Изначально компьютерное (eBook)
Интерактивное оглавление: Да
Количество страниц: 222
Описание: Learning how to write better Django code to build more maintainable websites either takes a lot of experience or familiarity with various design patterns. Filled with several idiomatic Django patterns, Django Design Patterns and Best Practices accelerates your journey into the world of web development.
Discover a set of common design problems, each tackling aspects of Django including model design and Views, and learn several recommended solutions with useful code examples and illustrations. You'll also get to grips with the current best practices in the latest versions of Django and Python. Creating a successful web application involves much more than Django, so advanced topics including REST, testing, debugging, security, and deployment are also explored in detail.
[spoiler="Примеры страниц"]

[/spoiler]
[spoiler="Оглавление"]
1:
Django and PatternsWhy Django?
The story of Django
What is a Pattern?
Patterns in this book
Best practices
Summary
2:
Application DesignHow to gather requirements
Are you a story teller?
HTML mockups
Designing the application
Before starting the project
SuperBook – your mission, should you choose to accept it
Summary
3:
ModelsM is bigger than V and C
The model hunt
Structural patterns
Retrieval patterns
Migrations
Summary
4:
Views and URLsA view from the top
Class-based generic views
View mixins
Decorators
View patterns
Designing URLs
Summary
5:
TemplatesUnderstanding Django's template language features
Organizing templates
Using Bootstrap
Template patterns
Summary
6:
Admin InterfaceUsing the admin interface
Enhancing models for the admin
Admin interface customizations
Protecting the admin
Summary
7:
FormsHow forms work
Displaying forms
Understanding CSRF
Form processing with Class-based views
Form patterns
Summary
8:
Dealing with Legacy CodeFinding the Django version
Where are the files? This is not PHP
Starting with urls.py
Jumping around the code
Understanding the code base
Incremental change or a full rewrite?
Write tests before making any changes
Legacy databases
Summary
9:
Testing and DebuggingWhy write tests?
Test-driven development
Writing a test case
Mocking
Pattern – test fixtures and factories
Learning more about testing
Debugging
The print function
Logging
The Django Debug Toolbar
The Python debugger pdb
Other debuggers
Debugging Django templates
Summary
10:
SecurityCross-site scripting (XSS)
A handy security checklist
Summary
11:
Production-readyProduction environment
Hosting
Deployment tools
Monitoring
Performance
Summary
[/spoiler]