settings.py is the Django project’s configuration script: a Python file of variable declarations that control Django’s behavior. It lives in the project configuration directory alongside urls.py, wsgi.py, and asgi.py. Think of it as the place where Django learns the project’s rules rather than guessing them. section 2.2 section 2.9
A newly created project already contains many settings. One important setting is INSTALLED_APPS, a list of string names for Django apps. Creating an app creates Python files, but does not activate the app; add its name to INSTALLED_APPS so Django recognizes it as an app instead of merely another module. section 2.4
Listing 2.1 Tell Django about your home app
# RiffMates/RiffMates/settings.py
... #1
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'home', #2
]
...
Add the home app’s name to INSTALLED_APPS after Django’s built-in apps. This explicit registration lets Django distinguish project apps from ordinary Python modules. section 2.4
Configure a logout destination
Settings also provide project-wide choices outside app registration. Set LOGOUT_REDIRECT_URL to the URL Django should use after logout; here, the band listing URL is used because a home page has not yet been built. LOGIN_REDIRECT_URL appears alongside it for account-management redirects. section 6.4.1
The development server reports which settings module it loaded, such as RiffMates.settings. That is a useful sanity check: Django is running with the configuration file you expect, not one hiding in a different project directory. section 2.2
