diff --git a/babybuddy/settings/.gitignore b/babybuddy/settings/.gitignore index 487159f7..8ab19179 100644 --- a/babybuddy/settings/.gitignore +++ b/babybuddy/settings/.gitignore @@ -6,5 +6,6 @@ !gitpod.py !heroku.py !production.example.py +!railway.py !render.py !test.py diff --git a/babybuddy/settings/railway.py b/babybuddy/settings/railway.py new file mode 100644 index 00000000..f691bd97 --- /dev/null +++ b/babybuddy/settings/railway.py @@ -0,0 +1,17 @@ +import dj_database_url + +from .base import * + +# Settings for Railway.app service. +# https://docs.railway.app/develop/variables + +APP_URL = os.environ.get("RAILWAY_STATIC_URL") +if APP_URL: + ALLOWED_HOSTS.append(APP_URL) + CSRF_TRUSTED_ORIGINS.append("".join(["https://", APP_URL])) + + +# Database +# https://docs.djangoproject.com/en/4.0/ref/settings/#databases + +DATABASES = {"default": dj_database_url.config(conn_max_age=500)}