Today’s Offer Enroll today and get access to premium content.
App Store Google Play
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:

  1. DEBUG: Enables debug mode for development.
  2. DATABASES: Configures the database connections.
  3. 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',
    }
}