appendix B Django in a production environment

 

If you’ve come from a world where most of your Python gets run locally or you send your script to a friend through email, moving to the world of the web can be rather daunting. Even if you’re an old pro at packaging things and submitting them to PyPI, the web has its own set of challenges. When you write something using Django, or any other web framework, you’re no longer just writing code. If you want to put your project on the web, you’re now dealing with infrastructure. It isn’t quite as scary as it sounds, but there are some things you need to be aware of.

Ask five different developers on the best way to put Django into production, and you’ll likely get at least six opinions. Part of that has to do with scale: Is your site for you and your friends, or is it going to handle a gajillion users? How you go into production depends on this question and, of course, the associated question of the costs therein. This appendix isn’t meant as an authoritative guide but more as an overview of the choices that are out there.

B.1 Parts of a web deployment

B.2 Server hosting vs. platform as a service

B.2.1 Virtual private servers

B.2.2 Platform as a service

B.3 Synchronous vs. asynchronous

B.4 Readying Django for production

B.4.1 Environment-specific configuration

B.4.2 Configuring email

B.4.3 Logging

B.4.4 Custom 404 and 500 pages

B.5 Static file management

B.6 Other databases

B.7 Caching

B.8 Putting it all together

B.8.1 Builds and releases

B.8.2 Monitoring

sitemap