- Dockerfile builds the npm bundle and serves the app with gunicorn - Gitea workflow runs tests, tags releases on main, pushes the image to the Gitea registry, and publishes to PyPI when PYPI_TOKEN is set - MANIFEST.in includes the built static bundle in distributions - License the project under BSD-3-Clause Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
1.4 KiB
Python
59 lines
1.4 KiB
Python
import os
|
|
|
|
import dj_database_url
|
|
|
|
from .base import * # noqa: F401,F403
|
|
|
|
DEBUG = False
|
|
|
|
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "*").split(",")
|
|
|
|
SECRET_KEY = os.environ.get("SECRET_KEY", "This isn't a good secret key default value, you should set one in the environment")
|
|
|
|
if os.environ.get("DATABASE_URL"):
|
|
DATABASES = {
|
|
"default": dj_database_url.config(),
|
|
}
|
|
else:
|
|
DATABASES = {
|
|
"default": {
|
|
"ENGINE": "django.db.backends.sqlite3",
|
|
"NAME": os.path.join("/data", "db.sqlite3"),
|
|
}
|
|
}
|
|
|
|
CORS_ALLOWED_ORIGINS = [o for o in os.environ.get("CORS_ALLOWED_ORIGINS", "").split(",") if o]
|
|
|
|
CSRF_TRUSTED_ORIGINS = [f"https://{h}" for h in ALLOWED_HOSTS if h != "*"]
|
|
|
|
if os.environ.get("SECURE_PROXY_SSL_HEADER"):
|
|
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
|
|
|
LOGGING = {
|
|
"version": 1,
|
|
"disable_existing_loggers": False,
|
|
"handlers": {
|
|
"console": {
|
|
"class": "logging.StreamHandler",
|
|
"level": "INFO",
|
|
},
|
|
},
|
|
"loggers": {
|
|
"root": {
|
|
"handlers": ["console"],
|
|
"level": "WARNING",
|
|
"propagate": True,
|
|
},
|
|
"privatestudio": {
|
|
"handlers": ["console"],
|
|
"level": "INFO",
|
|
"propagate": False,
|
|
},
|
|
},
|
|
}
|
|
|
|
try:
|
|
from local_settings import * # noqa: F401,F403
|
|
except ImportError:
|
|
pass
|