Skip to content

Django Settings

config/settings.py holds the project's settings.

These are the settings our project uses so far:

  • INSTALLED_APPS: The apps Django loads models, templates, and commands from. Ours are listed first, followed by Django's built-in django.contrib apps, such as the admin, auth, and sessions.
  • DATABASES: Which database to use. startproject sets it to a SQLite file in the project directory named db.sqlite3.
  • DEBUG: Whether an error or a 404 shows Django's debug page, with details such as the traceback or the URL patterns it tried. startproject sets it to True. Run your production site with DEBUG = False.
  • AUTH_USER_MODEL: The model Django uses for user accounts. Ours is "accounts.User", a subclass of the built-in user with the same fields. It has to be set before the first migrate, so we can add fields to it later without rebuilding the auth tables.

The rest keep the values startproject wrote. The comments at the top of the file link to the full list of settings and to Django's deployment checklist.