Deploy Django Application to Heroku

Version

  • Python: 2.7.3
  • Django: 1.7

What to do on localhost?

Start from

Important thing is to run

python manage.py collectstatic

If you use public CDN at frontend and also use Django admin feauture,be sure to run it to show the admin style correctly after finishing your application.

Run Heroku commands

heroku run python manage.py sqlmigrate [your_app] 0001

The 0001 is the number of your migration.

heroku run python manage.py migrate

Until now,model tables have been created in your database.

Create superuser

heroku run python manage.py createsuperuser

That’s all.

Settings

https://github.com/zhangjingqiang/qiang-commands/blob/master/qiang_commands/settings.py

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.