Commit 1e8db6e1 authored by Jon Yu's avatar Jon Yu
Browse files

Include dj-database-url, instructions

parent 043409ce
Pipeline #17198 passed with stage
in 14 seconds
......@@ -67,6 +67,18 @@ If using compose, you can run:
docker-compose exec app pip freeze > requirements.prod.txt
```
### Update settings.DATABASES
Use the appropriate database connection strings to set your databases. This template uses dj-database-url, so you will just need to set `DATABASE_URL` in your environment.
See [here](https://github.com/jacobian/dj-database-url#url-schema) for additional connection string formats.
If multiple databases are required, you can add to the DATABASES dict:
```python
'alternate_db': dj_database_url.parse(os.getenv('ALTERNATE_DB_CONN_STRING')),
```
### (Optional) Update settings for Django error emails
Set the following environment variables:
......
asgiref==3.2.7
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
cryptography==2.8
Django==3.0.4
gunicorn==20.0.4
idna==2.9
josepy==1.3.0
mozilla-django-oidc==1.2.3
pycparser==2.20
pyOpenSSL==19.1.0
pytz==2019.3
requests==2.23.0
six==1.14.0
sqlparse==0.3.1
urllib3==1.25.8
whitenoise==5.0.1
\ No newline at end of file
asgiref==3.2.7
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
cryptography==2.8
dj-database-url==0.5.0
Django==3.0.4
gunicorn==20.0.4
idna==2.9
josepy==1.3.0
mozilla-django-oidc==1.2.3
pycparser==2.20
pyOpenSSL==19.1.0
pytz==2019.3
requests==2.23.0
six==1.14.0
sqlparse==0.3.1
urllib3==1.25.8
whitenoise==5.0.1
Django~=3.0.4
whitenoise~=5.0.1
gunicorn~=20.0.4
mozilla-django-oidc~=1.2.3
\ No newline at end of file
mozilla-django-oidc~=1.2.3
dj-database-url~=0.5.0
\ No newline at end of file
......@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
import dj_database_url
def str_to_bool(val):
return val.lower() in ('yes', 'true', 'on', '1')
......@@ -145,10 +146,7 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
'default': dj_database_url.config(default='sqlite:///db.sqlite3')
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment