Files
project-managment/config/settings/production.py
T
sankalp 06ea5d2945 feat(config): streamline configuration and remove dev‑only settingsAdd custom user model and improve static/media handling.
- New Features
  - Introduce `AUTH_USER_MODEL` for a custom user.
  - Add `STATICFILES_DIRS` to explicitly point to the static directory.
  - Simplify email backend configuration using environment variables.

- Enhancements
  - Remove djinit boilerplate and development‑only settings.
  - Drop `corsheaders` middleware and `rest_framework_simplejwt.token_blacklist`.
  - Update `TEMPLATES` to include project templates via `BASE_DIR / "templates"`.
  - Clean up URL patterns, removing deprecated JWT endpoint comments.
  - Reorganize security settings and static storage configuration.

- Bug Fixes
  - (none)
2026-05-27 23:33:10 +05:45

26 lines
949 B
Python

from .base import *
DEBUG = False
SECRET_KEY = env("SECRET_KEY")
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=[])
DATABASES = {"default": env.db("DATABASE_URL")}
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = env("EMAIL_HOST", default="smtp.gmail.com")
EMAIL_PORT = env.int("EMAIL_PORT", default=587)
EMAIL_USE_TLS = env.bool("EMAIL_USE_TLS", default=True)
EMAIL_HOST_USER = env("EMAIL_HOST_USER", default="")
EMAIL_HOST_PASSWORD = env("EMAIL_HOST_PASSWORD", default="")
DEFAULT_FROM_EMAIL = env("EMAIL_HOST_USER", default="")
SERVER_EMAIL = env("EMAIL_HOST_USER", default="")
SECURE_SSL_REDIRECT = True
SECURE_HSTS_SECONDS = 31536000
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_PRELOAD = True
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
STORAGES["staticfiles"]["BACKEND"] = "whitenoise.storage.CompressedManifestStaticFilesStorage"