Add settings for Railway

This commit is contained in:
Christopher C. Wells 2022-05-30 20:09:38 -07:00
parent ad1484c2ae
commit d8e03dbf92
2 changed files with 18 additions and 0 deletions

View File

@ -6,5 +6,6 @@
!gitpod.py
!heroku.py
!production.example.py
!railway.py
!render.py
!test.py

View File

@ -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)}