Book description
Easily build maintainable websites with powerful and relevant Django design patterns
In Detail
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.
What You Will Learn
- Understand common design patterns that can help you write better Django code
- Discover the latest best practices and idioms in this rapidly evolving framework
- Deep dive into various aspects of Django from Models and Views to testing and deployment
- Get to grips with difficult topics such as dealing with legacy code and debugging
- Familiarize yourself with the various nuances of web development such as browser attacks and databases
- Reduce the maintenance burden with well-tested, cleaner code
- Show your work to the world by learning about hosting, deploying, and securing your Django projects
Table of contents
-
Django Design Patterns and Best Practices
- Table of Contents
- Django Design Patterns and Best Practices
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. Django and Patterns
- 2. Application Design
- 3. Models
- 4. Views and URLs
- 5. Templates
- 6. Admin Interface
- 7. Forms
- 8. Dealing with Legacy Code
- 9. Testing and Debugging
- 10. Security
- 11. Production-ready
-
A. Python 2 versus Python 3
- But I still use Python 2.7!
-
Python 3
- Python 3 for Djangonauts
- Change all the __unicode__ methods into __str__
- All classes inherit from the object class
- Calling super() is easier
- Relative imports must be explicit
- HttpRequest and HttpResponse have str and bytes types
- Exception syntax changes and improvements
- Standard library reorganized
- New goodies
- Other changes
- Further information
- Index
Product information
- Title: Django Design Patterns and Best Practices
- Author(s):
- Release date: March 2015
- Publisher(s): Packt Publishing
- ISBN: 9781783986644
You might also like
book
Django Design Patterns and Best Practices - Second Edition
Build maintainable websites with elegant Django design patterns and modern best practices About This Book Explore …
book
Designing Microservices with Django: An Overview of Tools and Practices
Explore microservices using the Python-based Django framework and review the benefits and drawbacks of them. This …
book
Web Development with Django
Learn how to create your own websites simply, safely, and quickly with Django by tackling practical …
book
Django 3 By Example - Third Edition
Learn Django 3 with four end-to-end web projects Key Features Learn Django 3 by building real-world …