Add environment config
This commit is contained in:
parent
ad537e737b
commit
1300132d69
1 changed files with 6 additions and 5 deletions
|
@ -11,23 +11,24 @@ https://docs.djangoproject.com/en/4.0/ref/settings/
|
|||
"""
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
MEDIA_ROOT = Path("/var/lib/nummi")
|
||||
MEDIA_ROOT = Path(os.environ.get("NUMMI_MEDIA_ROOT", "/var/lib/nummi"))
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = "h/0OOuNSBRJy9Suo172Y5sJYGgmDqanh"
|
||||
SECRET_KEY = os.environ.get("NUMMI_SECRET", "dev_sDo6gl1Yf8GIE7XEA2B4xF841eMOpfG1")
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = False
|
||||
DEBUG = os.environ.get("NUMMI_DEBUG", None) == "True"
|
||||
|
||||
ALLOWED_HOSTS = ["nummi.edgarpierre.fr"]
|
||||
CSRF_TRUSTED_ORIGINS = ["https://nummi.edgarpierre.fr"]
|
||||
ALLOWED_HOSTS = [os.environ.get("NUMMI_HOST", "localhost")]
|
||||
CSRF_TRUSTED_ORIGINS = [f"https://{os.environ.get('NUMMI_HOST', 'localhost')}"]
|
||||
|
||||
|
||||
# Application definition
|
||||
|
|
Loading…
Reference in a new issue