See Working with Django (https://devcenter.heroku.com/categories/working-with-django) for more information.
Procfile Create a Procfile and add the following.
Procfile
web: gunicorn PROJECTNAME.wsgi
settings.py Install django-heroku
pip install django-heroku
Add the following to settings.py
settings.py
import django_heroku
django_heroku.settings(locals())
requirements.txt Create requirements.txt in the root directory (under the project folder) and add the following
requirements.txt
django
gunicorn
django-heroku
brew install
)heroku login
```
### Creating an application
```
heroku create APPNAME
```
### git settings
```
heroku git:remote -a APPNAME
```
### buildpacks settings
```
heroku buildpacks:set heroku/python
```
## Deploy
### Deploy
```
git push heroku master
```
### Application launch
```
heroku open
```
## Other
### Command execution on heroku
```
heroku run COMMAND
```
Command interruption: `heroku run: detached COMMAND`
### log
```
heroku logs --t
```
### List of applications
```
heroku list
```
### Command execution for each application
```
heroku COMMAND --app APPNAME
```
Recommended Posts