Skip to content

Commit

Permalink
docs(settings): point all Django documentation links to stable docs
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Nov 22, 2024
1 parent 4866b48 commit e08771a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions apis_acdhch_default_settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
"drf_spectacular",
]

# https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-USE_X_FORWARDED_HOST
# https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-USE_X_FORWARDED_HOST
USE_X_FORWARDED_HOST = True
# https://docs.djangoproject.com/en/5.0/ref/settings/#secure-proxy-ssl-header
# https://docs.djangoproject.com/en/stable/ref/settings/#secure-proxy-ssl-header
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")

# drf-spectacular settings
Expand Down Expand Up @@ -121,7 +121,7 @@
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
}

# https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-MIDDLEWARE
# https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-MIDDLEWARE
MIDDLEWARE = [
"allow_cidr.middleware.AllowCIDRMiddleware",
"django.middleware.security.SecurityMiddleware",
Expand All @@ -136,10 +136,10 @@
"crum.CurrentRequestUserMiddleware",
]

# https://docs.djangoproject.com/en/5.0/ref/settings/#root-urlconf
# https://docs.djangoproject.com/en/stable/ref/settings/#root-urlconf
ROOT_URLCONF = "apis_acdhch_default_settings.urls"

# https://docs.djangoproject.com/en/5.0/ref/settings/#templates
# https://docs.djangoproject.com/en/stable/ref/settings/#templates
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
Expand All @@ -156,7 +156,7 @@
}
]

# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
# https://docs.djangoproject.com/en/stable/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"},
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
Expand All @@ -166,15 +166,15 @@


# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
# https://docs.djangoproject.com/en/stable/topics/i18n/
LANGUAGE_CODE = "en"
TIME_ZONE = "UTC"
USE_I18N = True
USE_L10N = True
USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
# https://docs.djangoproject.com/en/stable/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles/")
STATIC_URL = "/static/"
MEDIA_ROOT = os.path.join(BASE_DIR, "media/")
Expand All @@ -197,11 +197,11 @@
# https://github.com/mozmeao/django-allow-cidr
ALLOWED_CIDR_NETS = ["10.0.0.0/8", "127.0.0.0/8"]

# https://docs.djangoproject.com/en/5.0/ref/settings/#databases
# https://docs.djangoproject.com/en/stable/ref/settings/#databases
# https://github.com/jazzband/dj-database-url
DATABASES = {'default': dj_database_url.config(default='sqlite:///db.sqlite3', conn_max_age=600)}

# https://docs.djangoproject.com/en/5.0/ref/settings/#allowed-hosts
# https://docs.djangoproject.com/en/stable/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
if os.environ.get("PUBLIC_URL"):
ALLOWED_HOSTS.append(re.sub(r"https?://", "", os.environ.get("PUBLIC_URL")))
Expand All @@ -214,13 +214,13 @@
AUTH_LDAP_SERVER_URI = os.environ.get("ARZ_AUTH_LDAP_SERVER_URI")
AUTH_LDAP_USER_DN_TEMPLATE = "%(user)s@oeaw.ads"

# https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-AUTHENTICATION_BACKENDS
# https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-AUTHENTICATION_BACKENDS
AUTHENTICATION_BACKENDS = [
"apis_acdhch_default_settings.ldapauth.CustomLDAPBackend",
"django.contrib.auth.backends.ModelBackend",
]

# https://docs.djangoproject.com/en/5.0/howto/logging/
# https://docs.djangoproject.com/en/stable/howto/logging/
# setup logging to log everything to stdout
LOGGING = {
"version": 1,
Expand All @@ -242,7 +242,7 @@
},
}

# https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-DEBUG
# https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-DEBUG
if debug := os.environ.get("DJANGO_DEBUG", False):
DEBUG = debug.lower() == "true"

Expand Down

0 comments on commit e08771a

Please sign in to comment.