diff --git a/.gitignore b/.gitignore index b0c7f81..2a81894 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ coverage # Local data secrets.py +settings_local.py *.log media/ output/ diff --git a/sncf/settings.py b/sncf/settings.py index 13619f5..7b3d7c4 100644 --- a/sncf/settings.py +++ b/sncf/settings.py @@ -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 diff --git a/sncf/settings_local_example.py b/sncf/settings_local_example.py new file mode 100644 index 0000000..fafcabf --- /dev/null +++ b/sncf/settings_local_example.py @@ -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", + } +}