1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 06:44:21 +00:00

🔧 Configure basic database

This commit is contained in:
Steffo 2021-04-05 01:06:48 +02:00
parent 4761abd6ff
commit 611bc63afd

View file

@ -21,7 +21,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"] SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", "change-me-in-production")
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = bool(os.environ.get("DJANGO_DEBUG")) DEBUG = bool(os.environ.get("DJANGO_DEBUG"))
@ -77,11 +77,18 @@ WSGI_APPLICATION = 'sophon.wsgi.application'
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.postgresql',
'NAME': BASE_DIR / 'db.sqlite3', 'HOST': '', # Connect via UNIX socket (does not work on Windows)
'NAME': 'sophon',
'USER': 'sophon', # Connect using its own user, isolating sophon from the rest of the server
} }
} }
# Remember to run the following commands on a new installation:
# sudo -iu postgres
# createuser sophon
# createdb --owner=sophon sophon
# Password validation # Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators