Deployment on Heroku

120 views
Skip to first unread message

Aakash Baranwal

unread,
Mar 25, 2019, 3:07:08 AM3/25/19
to django...@googlegroups.com
Hi, I am Aakash. I have been working on a project which i want to deploy on heroku, but i have been facing some issues. I searched for solutions on the internet but none of them helped me.

I, request you to kindly help me with the deployment.

Pfa the settings.py, asgi.py , wsgi.py , Procfile.
Also, please check line no 34 in settings.py for the EMAIL_HOST_PASSWORD, if I am doing it the right way or it should be done as commented in the same line after the code.

As you will see in the terminal, it says Starting ASGI channels, so do i need the wsgi.py file anymore or should i run it with WSGI instead of ASGI?

When I push it into the heroku server and run the application, it does not run and in the heroku logs the error which it shows is :

 at=error code=H10 desc="App crashed" method=GET path="/" host=vibex.herokuapp.com request_id=3211546f-5081-4233-b016-428493e611c1 fwd="139.167.172.83" dyno= connect= service= status=503 bytes= protocol=http

and it also shows  bash: gunicorn: command not found
which I have installed on my computer as well as by using heroku run pip install gunicorn.

I shall be extremely thankful for your help.

Thanks in advance

With Kind Regards
Aakash
Screenshot from 2019-03-25 12-21-06.png
Screenshot from 2019-03-25 12-21-21.png
Screenshot from 2019-03-25 12-21-25.png
Screenshot from 2019-03-25 12-22-54.png
Screenshot from 2019-03-25 12-23-02.png
Screenshot from 2019-03-25 12-23-09.png
Screenshot from 2019-03-25 12-23-14.png
Screenshot from 2019-03-25 12-25-50.png

Ahmed Ishtiaque

unread,
Mar 25, 2019, 3:27:34 AM3/25/19
to django...@googlegroups.com
From the looks of it, it seems that in your procfile you need to point to the *exact* location gunicorn is installed in. So this could be somewhere like ~/.local/lib/pythonx.y/site-packages/gunicorn directory on your heroku instance (if it’s a Linux filesystem... I don’t remember what heroku uses exactly). 

Also yes, always use environment variables to import your passwords, security keys etc. in deployment.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALr9hQ12oZ4C1L6BtYyPGbQuwrezaeWzd8x9JkLXE8jM80nM5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Christhian Jesus

unread,
Mar 25, 2019, 3:53:43 AM3/25/19
to django...@googlegroups.com
Add gunicorn to requeriments.txt 

Aakash Baranwal

unread,
Mar 25, 2019, 5:22:12 AM3/25/19
to django...@googlegroups.com
It goes into the site-packages in linux as well but it was not showing there, infact even after I installed it there itself, then also it was not there, however when I checked in the terminal by reinstalling it said that requirement is already satisfied and its already in the requirements.txt file.

I used this command :
as per the guide in this gunicorn guide by digital ocean which is gunicorn --bind 0.0.0.0:8000 myproject.wsgi

Now when i run it in the browser, it says internal server error and the terminal shows this error:

  File "/home/aakash/Dev/tweetme/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 135, in handle
    self.handle_request(listener, req, client, addr)
  File "/home/aakash/Dev/tweetme/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
TypeError: __call__() takes 2 positional arguments but 3 were given


Kindly tell me what I might be doing wrong and also check my procfile if I am going the right way

Aakash Baranwal

unread,
Mar 25, 2019, 5:22:17 AM3/25/19
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages