Create basic render.com configuration

This commit is contained in:
Christopher C. Wells 2022-05-22 14:04:03 -07:00 committed by Christopher Charbonneau Wells
parent afea4376b9
commit 369c4d9bc6
3 changed files with 41 additions and 0 deletions

View File

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

View File

@ -0,0 +1,19 @@
import dj_database_url
from .base import *
RENDER_EXTERNAL_HOSTNAME = os.environ.get('RENDER_EXTERNAL_HOSTNAME')
if RENDER_EXTERNAL_HOSTNAME:
ALLOWED_HOSTS.append(RENDER_EXTERNAL_HOSTNAME)
CSRF_TRUSTED_ORIGINS.append(RENDER_EXTERNAL_HOSTNAME)
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
DATABASES = {
'default': dj_database_url.config(
default='postgresql://postgres:postgres@localhost:5432/babybuddy',
conn_max_age=600
)
}

21
render.yaml Normal file
View File

@ -0,0 +1,21 @@
databases:
- name: babybuddy
databaseName: babybuddy
user: babybuddy
services:
- type: web
name: babybuddy
env: python
startCommand: "gunicorn babybuddy.wsgi:application"
envVars:
- key: DJANGO_SETTINGS_MODULE
value: babybuddy.settings.render
- key: DATABASE_URL
fromDatabase:
name: babybuddy
property: connectionString
- key: SECRET_KEY
generateValue: true
- key: WEB_CONCURRENCY
value: 4