-
Book Overview & Buying
-
Table Of Contents
Mastering Django: Core
By :
In some cases, you might want to bypass the DJANGO_SETTINGS_MODULE environment variable. For example, if you're using the template system by itself, you likely don't want to have to set up an environment variable pointing to a settings module. In these cases, you can configure Django's settings manually. Do this by calling:
django.conf.settings.configure(default_settings, **settings)
Example:
from django.conf import settings settings.configure(DEBUG=True, TEMPLATE_DEBUG=True)
Pass configure() as many keyword arguments as you'd like, with each keyword argument representing a setting and its value. Each argument name should be all uppercase, with the same name as the settings described above. If a particular setting is not passed to configure() and is needed at some later point, Django will use the default setting value.
Configuring Django in this fashion is mostly necessary-and, indeed, recommended-when you're...
Change the font size
Change margin width
Change background colour