Using different settings for production

So far in this book, we've dealt with only a single settings file: the settings.py generated by django-admin startproject. But as you get ready to deploy, you'll likely find yourself needing multiple settings files to keep your development environment isolated from your production environment. (For example, you probably won't want to change DEBUG from False to True whenever you want to test code changes on your local machine.) Django makes this very easy by allowing you to use multiple settings files. If you'd like to organize your settings files into production and development settings, you can accomplish this in one of three ways:

  • Set up two full-blown, independent settings files.
  • Set up a base settings ...

Get Mastering Django: Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.