Skip to content

Commit

Permalink
Reorder base settings to be consistent with other projects
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack authored Nov 10, 2024
1 parent 7ca11df commit f7bfd0e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions example_project/example_project/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
# Fetch version from the environment which is passed through from the latest git version tag
PROJECT_VERSION = env.str("PROJECT_VERSION", default="vX.Y.Z") # type: ignore

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

# Needed by sites framework
SITE_ID = 1

Expand Down Expand Up @@ -109,6 +106,9 @@

ASGI_APPLICATION = "example_project.asgi.application"

# This seems to be important for Cloud IDEs as CookieStorage does not work there.
MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

# Loads the DB setup from the DATABASE_URL environment variable.
DATABASES = {"default": env.db()}

Expand Down Expand Up @@ -140,11 +140,16 @@
# A custom authentication backend that supports a single currently active group.
AUTHENTICATION_BACKENDS = ["adit_radis_shared.accounts.backends.ActiveGroupModelBackend"]

# Where to redirect to after login
LOGIN_REDIRECT_URL = "home"

# Settings for django-registration-redux
REGISTRATION_FORM = "adit_radis_shared.accounts.forms.RegistrationForm"
ACCOUNT_ACTIVATION_DAYS = 14
REGISTRATION_OPEN = True

EMAIL_SUBJECT_PREFIX = "[ADIT-RADIS-Shared] "

# The email address critical error messages of the server will be sent from.
SERVER_EMAIL = env.str("DJANGO_SERVER_EMAIL")

Expand All @@ -168,6 +173,8 @@
],
}

# TODO: Setup LOGGING

# Internationalization
# https://docs.djangoproject.com/en/5.0/topics/i18n/

Expand All @@ -182,11 +189,6 @@
# A timezone that is presented to the users of the web interface.
USER_TIME_ZONE = env.str("USER_TIME_ZONE")

# This seems to be important for development on Gitpod as CookieStorage
# and FallbackStorage does not work there.
# Seems to be the same problem with Cloud9 https://stackoverflow.com/a/34828308/166229
MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/
STATIC_URL = "static/"
Expand Down

0 comments on commit f7bfd0e

Please sign in to comment.