2022-05-22 21:04:03 +00:00
|
|
|
import dj_database_url
|
|
|
|
|
|
|
|
from .base import *
|
|
|
|
|
2022-05-22 22:24:04 +00:00
|
|
|
RENDER_EXTERNAL_HOSTNAME = os.environ.get("RENDER_EXTERNAL_HOSTNAME")
|
2022-05-22 21:04:03 +00:00
|
|
|
if RENDER_EXTERNAL_HOSTNAME:
|
|
|
|
ALLOWED_HOSTS.append(RENDER_EXTERNAL_HOSTNAME)
|
2022-05-22 21:34:48 +00:00
|
|
|
CSRF_TRUSTED_ORIGINS.append("".join(["https://", RENDER_EXTERNAL_HOSTNAME]))
|
2022-05-22 21:04:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Database
|
|
|
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
|
|
|
|
|
|
|
DATABASES = {
|
2022-05-22 22:24:04 +00:00
|
|
|
"default": dj_database_url.config(
|
|
|
|
default="postgresql://postgres:postgres@localhost:5432/babybuddy",
|
|
|
|
conn_max_age=600,
|
2022-05-22 21:04:03 +00:00
|
|
|
)
|
|
|
|
}
|