settings

Installation
SKILL.md

Organize Django Settings

When modifying src/project/settings.py, enforce this structure.

Section Format

Every logical group of settings gets a banner header:

# =============================================================================
# SECTION NAME
# =============================================================================
  • Banner lines are exactly 77 characters (# + 75 = characters)
  • Section name is UPPERCASE
  • One blank line before each banner (except at top of file)
  • No blank lines between the banner and the first setting in that section
  • No inline comments explaining what standard Django settings do — the section header is enough

Section Order

Settings must appear in this order. Omit sections that have no settings.

  1. Imports and BASE_DIR (no banner — these are preamble)
  2. LOGGING
  3. SECURITYSECRET_KEY, DEBUG, ALLOWED_HOSTS, CORS, CSRF, cookie settings
  4. APPLICATION DEFINITIONINSTALLED_APPS, MIDDLEWARE
  5. URLS AND WSGIROOT_URLCONF, WSGI_APPLICATION
  6. TEMPLATES
  7. AUTHAUTH_USER_MODEL, AUTH_PASSWORD_VALIDATORS, LOGIN_URL
  8. DATABASE
  9. SESSIONS
  10. CACHING
  11. INTERNATIONALIZATIONLANGUAGE_CODE, TIME_ZONE, USE_I18N, USE_TZ
  12. STATIC FILESSTATIC_URL, STATIC_ROOT, DEFAULT_AUTO_FIELD
  13. CELERY — all CELERY_* settings
  14. Any additional project-specific sections in alphabetical order

INSTALLED_APPS Sub-grouping

Within INSTALLED_APPS, group entries with inline comments:

INSTALLED_APPS = [
    # Django core
    "django.contrib.admin",
    ...
    # Third-party
    "corsheaders",
    ...
    # Project apps
    "products.apps.ProductsConfig",
    "orders.apps.OrdersConfig",
]

Project apps must use the dotted path to their AppConfig subclass (e.g., "myapp.apps.MyAppConfig"), not the short app name.

Rules

  • Do NOT add Django docs URLs as comments (e.g., # https://docs.djangoproject.com/...)
  • Do NOT add "Quick-start" or "Generated by" boilerplate comments
  • Keep AUTH_PASSWORD_VALIDATORS compact — one dict per line when the only key is "NAME"
  • When adding a new setting, place it in the correct existing section. Create a new section only if none fit.
Related skills

More from dvf/opinionated-django

Installs
10
GitHub Stars
104
First Seen
Apr 11, 2026