Beginner
What is the purpose of Django's settings.py file?
The settings.py
file in Django contains all the configuration settings for your project, such as database configurations, static files handling, and installed apps.
Key settings include:
DEBUG
: Enables debug mode for development.DATABASES
: Configures the database connections.INSTALLED_APPS
: Lists the applications used in the project.
Example of database settings:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}