Compare commits
2 Commits
main
...
deployment
Author | SHA1 | Date | |
---|---|---|---|
a534b12ae9 | |||
26c755aa47 |
@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/5.0/ref/settings/
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
import dj_database_url
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
@ -32,8 +33,15 @@ ALLOWED_HOSTS = ['127.0.0.1']
|
||||
|
||||
DEBUG_PROPAGATE_EXCEPTIONS = True
|
||||
|
||||
# Application definition
|
||||
|
||||
SECURE_HSTS_SECONDS = 31536000 # One year
|
||||
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
|
||||
SECURE_HSTS_PRELOAD = True
|
||||
SECURE_SSL_REDIRECT = True
|
||||
SESSION_COOKIE_SECURE = True
|
||||
CSRF_COOKIE_SECURE = True
|
||||
|
||||
# Application definition
|
||||
INSTALLED_APPS = [
|
||||
"django.contrib.admin",
|
||||
"django.contrib.auth",
|
||||
@ -89,6 +97,11 @@ DATABASES = {
|
||||
}
|
||||
}
|
||||
|
||||
if 'DATABASE_URL' in os.environ:
|
||||
DATABASES['default'] = dj_database_url.config(
|
||||
conn_max_age=500,
|
||||
conn_health_checks=True,
|
||||
)
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
|
||||
|
Loading…
x
Reference in New Issue
Block a user