Most of the website configuration that you need to implement is done in the settings.py file. When you create a new project, Django automatically adds the settings.py file to the project's root directory. The settings.py file contains the configuration for databases, installed applications, and numerous other configuration settings. The Django framework relies heavily on the settings.py file to define all kinds of behavior.
You can also use the settings.py file to set your own global settings for the website. You can access this file as an object from within Python code in your projects. To access the settings.py file, import the settings object, as shown in the following example:
from django.conf import settings.py if settings.MY_CUSTOM_SETTING: #perform custom work
Watch Out!
Do not try to modify settings in the settings.py file on-the-fly from Python code in your project. This can have unexpected (bad) results.
Throughout this book, we will discuss several different settings that you need to make in the settings.py file. You can find more information about the settings.py options at http://www.djangoproject.com/documentation/settings.