Prerequisites (Modified)
To follow this tutorial, you will need
- An account on Heroku
- The Heroku toolbelt
- Installed Python and Virtualenv. See this guide for guidance.
- An installed version of Postgres to test locally. Follow this guide, but stop after the step "Restart Postgres".
Local Notes Application Setup
Make a new folder called web in your home directory and go into it
$ cd ~ $ mkdir web $ cd web
Checkout the notes application from git
$ git clone git@github.com:theicfire/heroku-django-notes.git
Go into the newly created directory and activate the environment:
$ cd heroku-django-notes $ source venv/bin/activate
Change the database credentials by modifying the following line in main/settings.py to your Postgresql password
'PASSWORD': 'yourpass', # Not used with sqlite3.
Run the server:
$ foreman start
Go to localhost:5000 to make sure everything is working.
Deploy to Heroku
Go to the Heroku Django Tutorial and follow this instructions under "Deploy to Heroku"Done
You should now be done with a fully functioning notes application, deployed on Heroku!
Notes and Troubleshooting
If you can't connect to database, make sure it's running and that the port in your settings.py file is correct:
$ grep postgresql /etc/services
postgresql 5432/tcp postgres # PostgreSQL Database
postgresql 5432/udp postgres
The above output means that Posgresql is running on port 5432. Make sure this is consistent with that in your main/settings.py file.
No comments:
Post a Comment