Having issues with your first Django deployment on Heroku?

After spending a part of the night swearing at Heroku for not seeing my Django app correctly, I have realized it requires a very specific folder structure to operate properly.

In my case, my whole Django project was in a subdirectory of my git repo (git_root > django_project > django_project > settings.py), while Heroku expects the following structure: git_root > django_project > settings.py.

Some other problems I have encountered:

  • Make sure you have everything you need in your requirements.txt file
  • Add your Procfile and requirements.txt to git
  • Don’t forget to run syncdb on the server: heroku run python manage.py syncdb

Still in a tough spot? Use heroku logs to figure out what’s going on. If you don’t see any error message, try heroku restart. It will usually generate a few errors to work from.

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax