O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

29.2.3 Preparing Django Settings

When we deploy to production, there are several changes we must always remember to make. The two largest are: keep the SECRET_KEY in the project setting secret and set DEBUG to False.

The problem with changing these settings is that it makes it harder to actually develop the website, where you want DEBUG to be True and you simply want the development server to run, never mind the security key.

To handle both development, production, and any other possible environment, developers split the settings.py file into multiple files. We thus delete suorganizer/settings.py and create the suorganizer/settings/ directory with multiple files. The dev.py file contains all of the settings specific to development, while the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required