Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Django Design Patterns and Best Practices

You're reading from   Django Design Patterns and Best Practices Industry-standard web development techniques and solutions using Python

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781788831345
Length 282 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Arun Ravindran Arun Ravindran
Author Profile Icon Arun Ravindran
Arun Ravindran
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Django and Patterns 2. Application Design FREE CHAPTER 3. Models 4. Views and URLs 5. Templates 6. Admin Interface 7. Forms 8. Working Asynchronously 9. Creating APIs 10. Dealing with Legacy Code 11. Testing and Debugging 12. Security 13. Production-Ready 14. Python 2 Versus Python 3 15. Other Books You May Enjoy

Future proofing


A well-written code base is a pleasure to work with. A poorly organized and brittle code base usually ends up as legacy code and hinders innovation. So how can you reduce the chances of your application being considered as legacy? Here are some recommendations:

  • Django deprectations: Deprectations tell you whether a feature or idiom will be discontinued from Django in the future. Since Django 1.11, they are quiet by default. Use python -Wd so that deprecation warnings do appear.
  • Code reviews: Ensure high code quality and encourage best practices in reviews.
  • Consistent Formatting: Use a code formatter like black before committing code to reduce review time
  • Increase code coverage: Write more tests, especially unit tests.
  • Type hinting: Use type hinting to perform static analysis of Python 3 code and reduce the number of test cases.
  • Configuration management: Have strong version control and other configuration management practices to ensure replicable environments and painless rollbacks...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime