Update Docker configuration and production settings for improved environment management
This commit is contained in:
parent
0ad93cfb78
commit
a72e23e9e0
@ -1,3 +1,11 @@
|
|||||||
fly.toml
|
fly.toml
|
||||||
.git/
|
.git/
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
.venv/
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
*.sqlite3
|
*.sqlite3
|
||||||
|
*.log
|
||||||
|
media/
|
||||||
|
static/
|
||||||
|
|||||||
@ -4,6 +4,7 @@ FROM python:${PYTHON_VERSION}
|
|||||||
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
ENV DJANGO_SETTINGS_MODULE=mysite.settings.production
|
||||||
|
|
||||||
RUN mkdir -p /code
|
RUN mkdir -p /code
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
|
|
||||||
from .base import *
|
from .base import *
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
@ -8,6 +12,19 @@ DEBUG = False
|
|||||||
# See https://docs.djangoproject.com/en/5.2/ref/contrib/staticfiles/#manifeststaticfilesstorage
|
# See https://docs.djangoproject.com/en/5.2/ref/contrib/staticfiles/#manifeststaticfilesstorage
|
||||||
STORAGES["staticfiles"]["BACKEND"] = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
|
STORAGES["staticfiles"]["BACKEND"] = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
|
||||||
|
|
||||||
|
def _csv(key, fallback):
|
||||||
|
value = os.getenv(key, fallback)
|
||||||
|
return [item.strip() for item in value.split(",") if item.strip()]
|
||||||
|
|
||||||
|
|
||||||
|
SECRET_KEY = os.getenv("DJANGO_SECRET_KEY")
|
||||||
|
if not SECRET_KEY:
|
||||||
|
raise ImproperlyConfigured("DJANGO_SECRET_KEY must be set in production.")
|
||||||
|
|
||||||
|
ALLOWED_HOSTS = _csv("DJANGO_ALLOWED_HOSTS", "innovedus-cms.fly.dev")
|
||||||
|
CSRF_TRUSTED_ORIGINS = _csv("DJANGO_CSRF_TRUSTED_ORIGINS", "https://innovedus-cms.fly.dev")
|
||||||
|
WAGTAILADMIN_BASE_URL = os.getenv("WAGTAILADMIN_BASE_URL", WAGTAILADMIN_BASE_URL)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .local import *
|
from .local import *
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user