Deployment on Heroku

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Deployment on Heroku

Aakash Baranwal
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

Screenshot from 2019-03-25 12-21-06.png (107K) Download Attachment
Screenshot from 2019-03-25 12-21-21.png (138K) Download Attachment
Screenshot from 2019-03-25 12-21-25.png (148K) Download Attachment
Screenshot from 2019-03-25 12-22-54.png (248K) Download Attachment
Screenshot from 2019-03-25 12-23-02.png (240K) Download Attachment
Screenshot from 2019-03-25 12-23-09.png (224K) Download Attachment
Screenshot from 2019-03-25 12-23-14.png (201K) Download Attachment
Screenshot from 2019-03-25 12-25-50.png (107K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Deployment on Heroku

aishtiaque
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.

On Mon, Mar 25, 2019 at 3:07 AM Aakash Baranwal <[hidden email]> wrote:
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAKizqR6PP%2BROesNLjjXLWfX%3Dz8FdL4NJXqTpDtNzrkesYRYcsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Deployment on Heroku

Christhian Jesus
Add gunicorn to requeriments.txt 

On Mon, Mar 25, 2019 at 3:26 AM Ahmed Ishtiaque <[hidden email]> wrote:
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.

On Mon, Mar 25, 2019 at 3:07 AM Aakash Baranwal <[hidden email]> wrote:
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAKizqR6PP%2BROesNLjjXLWfX%3Dz8FdL4NJXqTpDtNzrkesYRYcsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAMQeudrvzzkbS4-ghdG-pmsm2%3Dx7L%3DfY7q-myj_3uCBStYyw6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Deployment on Heroku

Aakash Baranwal
In reply to this post by aishtiaque
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

On Mon, Mar 25, 2019 at 12:56 PM Ahmed Ishtiaque <[hidden email]> wrote:
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.

On Mon, Mar 25, 2019 at 3:07 AM Aakash Baranwal <[hidden email]> wrote:
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAKizqR6PP%2BROesNLjjXLWfX%3Dz8FdL4NJXqTpDtNzrkesYRYcsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CALr9hQ0PLO4U3sHazTctMFrxXouqeFQ1%2BrKqy%3D%3DTxPJURH4JaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Deployment on Heroku

Aakash Baranwal
In reply to this post by Christhian Jesus
Its already present there.

On Mon, Mar 25, 2019 at 1:23 PM Christhian Jesus <[hidden email]> wrote:
Add gunicorn to requeriments.txt 

On Mon, Mar 25, 2019 at 3:26 AM Ahmed Ishtiaque <[hidden email]> wrote:
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.

On Mon, Mar 25, 2019 at 3:07 AM Aakash Baranwal <[hidden email]> wrote:
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAKizqR6PP%2BROesNLjjXLWfX%3Dz8FdL4NJXqTpDtNzrkesYRYcsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAMQeudrvzzkbS4-ghdG-pmsm2%3Dx7L%3DfY7q-myj_3uCBStYyw6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CALr9hQ2bPF%3DZ-0UhGd4M%2BeSSP%2BL5U2J2qn0rHUQ3yAqmToC49w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.