Django does not work on the hero

The following tutorial, “Getting Started with Django on heroku / ceadar” for writing and FINALLY managed to deal with some problems when deploying applications.

Successfully installed django psycopg2 Cleaning up... Discovering process types Procfile declares types -> (none) Compiled slug size is 8.0MB Launching... done, v4 http://<watever>.herokuapp.com deployed to Heroku 

and the manual says that the web server must be turned on. but heroku ps does not show processes, and obviously the page is not loading.

heroku magazine tail:

 2012-01-19T10:28:29+00:00 heroku[web.1]: State changed from created to down 2012-01-19T10:28:30+00:00 heroku[web.1]: State changed from down to created 2012-01-19T10:28:32+00:00 heroku[slugc]: Slug compilation finished 2012-01-19T10:30:32+00:00 heroku[router]: Error H99 (Platform error) -> GET <watever> .herokuapp.com/ dyno= queue= wait= service= status=503 bytes= (venv) C:\Python27\facebook\venv\myapp>heroku ps Process State Command ------- ----- ------- 

Should I explicitly run the web server? Wat am i doing wrong?

+7
source share
5 answers

The Procfile that I use for my django / heroku instance is as follows:

 web: python hellodjango/manage.py runserver "0.0.0.0:$PORT" 

As already mentioned, if you do not have a Procfile and you use the default web server, it will essentially do this, but try to be explicit. You can try running it from the heroku console to find out what (if any) errors it will receive:

 heroku run python hellodjango/manage.py runserver 
+8
source

I came across the same problem, although I do not know if it was for the same reason or not.

Running this command from the tutorial:

django-admin.py startproject hellodjango.

I changed the name of the application to something else (not only in this command, of course), but I omitted '.' in the end. This led to the script creating the application inside the same name in the correct directory I was in, and that the server side of the Heroku script could not detect the application as a Django application.

+3
source

I ran into this problem. Make sure your Procfile looks correct by running ...

 $heroku run bash 

to open a terminal with access to the hero. And then...

 $cat Procfile 

This will show you what is actually in your Procfile. For this reason, the first line (in my local file) was not read. Then I had "}" added to my file. I created my file in TextEdit on Mac - I had to use SublimeText or another text editor. You can also call

 $echo "web: gunicorn hello:app" >> Procfile 

Or what you want your Procfile to say. This will change your Procfile to whatever you echo.

+3
source

I fought Django on Heroku for a long time and decided to put together a very stubborn but functioning bootstrap. I hope this can help others on the road: https://github.com/callmephilip/django-heroku-bootstrap

+1
source

The key is here:

 Procfile declares types -> (none) 

Heroku does not know how to run your application. I assume that python hellodjango/manage.py runserver works locally for you? If so, Heroku will have to understand this.

Also check that you have requirements.txt in the root of the repo and settings.py in one of the project subdirectories.

0
source

All Articles