Skip to content
Snippets Groups Projects
Commit a0ff58ea authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Add ENVIRONMENT to settings

parent 0c037da3
No related branches found
No related tags found
1 merge request!115Greg 86 notification format changes
...@@ -11,7 +11,7 @@ https://docs.djangoproject.com/en/3.2/ref/settings/ ...@@ -11,7 +11,7 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
""" """
from pathlib import Path from pathlib import Path
from typing import List from typing import List, Literal
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
...@@ -262,6 +262,8 @@ NOTIFICATION_PUBLISHER = { ...@@ -262,6 +262,8 @@ NOTIFICATION_PUBLISHER = {
} }
INSTANCE_NAME = "local" INSTANCE_NAME = "local"
# i.e. 'prod', 'test', ...
ENVIRONMENT = "unknown"
INTERNAL_RK_PREFIX = "no.{instance}.greg".format(instance=INSTANCE_NAME) INTERNAL_RK_PREFIX = "no.{instance}.greg".format(instance=INSTANCE_NAME)
FEIDE_SOURCE = "feide" FEIDE_SOURCE = "feide"
...@@ -2,6 +2,8 @@ from .base import * ...@@ -2,6 +2,8 @@ from .base import *
# This is the default configuration file when running manage.py # This is the default configuration file when running manage.py
ENVIRONMENT = "dev"
ALLOWED_HOSTS += ["localhost", "127.0.0.1"] ALLOWED_HOSTS += ["localhost", "127.0.0.1"]
# EMAIL_HOST = "smtp.uio.no" # EMAIL_HOST = "smtp.uio.no"
# EMAIL_PORT = "468" # EMAIL_PORT = "468"
......
...@@ -5,6 +5,8 @@ from .base import * ...@@ -5,6 +5,8 @@ from .base import *
# This is the default configuration file when starting the app through # This is the default configuration file when starting the app through
# either greg.wsgi.application or greg.asgi.application # either greg.wsgi.application or greg.asgi.application
ENVIRONMENT = "prod"
# Put secret production settings in local.py # Put secret production settings in local.py
DEBUG = False DEBUG = False
......
from .dev import * from .dev import *
ENVIRONMENT = "unittest"
AUTHENTICATION_BACKENDS = [ AUTHENTICATION_BACKENDS = [
"gregui.authentication.auth_backends.DevBackend", # Fake dev backend "gregui.authentication.auth_backends.DevBackend", # Fake dev backend
"django.contrib.auth.backends.ModelBackend", # default "django.contrib.auth.backends.ModelBackend", # default
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment