Update django.md

main
Matt Huntington 5 years ago committed by GitHub
parent 733d208cf7
commit 5715cec530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -297,6 +297,12 @@ Copy the heroku url that was created (without the `https://`), go to your `djang
ALLOWED_HOSTS = ['localhost', 'agile-earth-74098.herokuapp.com'] ALLOWED_HOSTS = ['localhost', 'agile-earth-74098.herokuapp.com']
``` ```
Add `dj_database_url` so that production will get the database info from environment variables:
```
python -m pip install dj_database_url
```
At the top of `django_rest_api/settings.py` add `import dj_database_url`: At the top of `django_rest_api/settings.py` add `import dj_database_url`:
```python ```python
@ -327,7 +333,9 @@ create `Procfile` and add
web: gunicorn django_rest_api.wsgi web: gunicorn django_rest_api.wsgi
``` ```
create `Pipfile` and add This will help heroku know how to build your app
Create `Pipfile` and add
``` ```
[[source]] [[source]]
@ -353,6 +361,8 @@ python_version = "3.9.1"
``` ```
**Note:** on the last line, substitute your version of python (`python --version`) **Note:** on the last line, substitute your version of python (`python --version`)
This will tell heroku what packages it needs
### On the Browser ### On the Browser
1. Go to your heroku dashboard for the heroku project you just created 1. Go to your heroku dashboard for the heroku project you just created

Loading…
Cancel
Save