appendix-b

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.

[Note]  Note

Throughout this appendix I will be mentioning companies that provide a variety of hosting services. This is not an endorsement; Google-ing a provider name and "alternatives" or "competitors" is a good way to get a list of choices to choose from.

B.1 Parts of a web deployment

B.2 Server hosting vs Platform-as-a-Service

B.2.1 Virtual Private Server

B.2.2 Platform-as-a-Service (PaaS)

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