Add Django local parameters

This commit is contained in:
Emmy D'Anello 2024-02-02 01:00:05 +01:00
parent 10dac73146
commit 74a5cf7cbf
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 31 additions and 2 deletions

1
.gitignore vendored
View File

@ -33,6 +33,7 @@ coverage
# Local data
secrets.py
settings_local.py
*.log
media/
output/

View File

@ -22,7 +22,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure-&900+#-_$xydt$nz3xe_6pe&*f#=7hiqal6@ndtt7v2oixhu@y"
SECRET_KEY = "CHANGE ME"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
@ -135,7 +135,9 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/
STATIC_URL = "static/"
STATIC_URL = "api-static/"
STATIC_ROOT = BASE_DIR / "static_files"
# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
@ -147,3 +149,9 @@ REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 20,
}
try:
from settings_local import *
except ImportError:
pass

View File

@ -0,0 +1,20 @@
SECRET_KEY = "CHANGE ME"
DEBUG = False
ALLOW_HOSTS = ['sncf.emy.lu']
CORS_ALLOWED_ORIGINS = [
"https://sncf.emy.lu",
]
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "sncf",
"USER": "sncf",
"PASSWORD": "CHANGE ME",
"HOST": "localhost",
"PORT": "5432",
}
}