django Procfile for heroku deployment using gunicorn - django

According to this documentation, the Procfile format is
<process type>: <command>
For example:
web: gunicorn djforms.wsgi --log-file -
However, I found a Django project where the Procfile was missing : after web. i.e.
web gunicorn djforms.wsgi --log-file -
It also worked correctly when I tried to deploy to heroku. Any Idea on why it works or issues it may cause? Any help will be appreciated!

Related

What do I put in the Procfile for Gunicorn with Django?

I have uploaded by git repo to Heroku, but I am having a hard time finding out the gunicorn command to put in the Procfile. This is my repo path to the wsgi.py
So what should I put in my Procfile.
web: gunicorn image_editor.wsgi --log-file -
is my current Procfile but there is a module not found error. Thanks
Edit: Error is this ModuleNotFoundError: No module named 'image_editor'
Do pip install gunicorn in your local environment and add it to requirements.txt
I had to change the project structure, Procfile should be with manage.py

Having trouble getting django heroku to run properly. How do I resolve error code=H14 desc="No web processes running"?

I have previously ran this app on Heroku without issues. But it had been around 6 months since I deployed and I also switched computers from a Linux to a Windows machine.
Now when I deploy, the deployment is successful but the service does not work. When I check the logs the error is:
code=H14 desc="No web processes running"
I have not changed the Procfile or the requirements.txt since it had been working
requirements.txt:
django
gunicorn
django-heroku
requests
djangorestframework
django-cors-headers
flask-sslify
Procfile:
release: python manage.py migrate
web: gunicorn findtheirgifts.wsgi --log-file -
wsgi.py
"""
WSGI config for findtheirgifts project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "findtheirgifts.settings")
application = get_wsgi_application()
I have tried some suggestions from similar threads
heroku ps:restart
heroku buildpacks:clear
heroku ps:scale web=1
None of which seemed to change anything. Any help on this would be greatly appreciated!
As the error indicates, your app doesn't have any web process running.
You can see all running processes from the CLI with the following command:
heroku ps -a <your app name>
And scale your web process to 1 with the following:
heroku ps:scale web=1 -a <your app name>
Which will start one instance of your app.
See the Heroku Scaling Documentation.
Turns out in initialized the heroku git file in a different directory than I had previously. Causing the app to not find the Procfile.

Successfully Deployed to Heroku however page is not showing anything

Hi I have successfully deployed the python django app to heroku with no errors. However when i go to the link it just does not show anything.
heroku logs show me there's some H14 error.
Procfile.txt had been added with web: python manage.py runserver 0.0.0.0:6000
Why is the page still not showing up and it shows that no dynos are active.
URL: https://guarded-castle-63814.herokuapp.com/
The runserver is used for develop, on production use gunicorn.
Procfile
web: gunicorn config.wsgi

deploying mezzanine 3.0 on heroku

does anyone have the proper guide to deploy mezzanine on heroku? I couldn't get gunicorn to work.
My procfile is
web: python manage.py collectstatic --noinput; python manage.py run_gunicorn -b 0.0.0.0:$PORT
I saw there's fabfile.py which assist with gunicorn deployment. Could i utilize it for heroku? And how?

gunicorn on heruko binding to localhost, without messing up deployment to heruko

This is a spin off question from gunicorn on heroku: binding to localhost.
How can I get gunicorn to work both locally (using foreman) and for deployment on Heroku?
Procfile contains:
web: gunicorn mysite.wsgi
When I deploy locally using foreman, gunicorn binds to http://0.0.0.0:5000. I want it to bind to 127.0.0.1:8000. However, if I change to the Procfile to this:
web: gunicorn -b 127.0.0.1:8000 mysite.wsgi
Then I can't deploy to Heroku, the browser will return "application error"
$ heroku ps
=== web (1X): `gunicorn -b 127.0.0.1:8000 mysite.wsgi`
web.1: crashed 2013/08/22 23:45:04 (~ 1m ago)
Where is the default binding address set and/or what gunicorn options do I put in Procfile to get it to work on 127.0.0.1?
What could be unique to my situation that causes a deviant default setup (I'm working in mac OS - lion, maybe?)
Dont bind gunicorn to the local ip with. web: gunicorn -b 127.0.0.1:8000 mysite.wsgi in your procfile. This forces your django app to always use this local port whether or not its deployed locally or on Heroku's servers.
Using
web: gunicorn mysite.wsgi
in your procfile will make your application deploy at 127.0.0.1:8000 locally and 0.0.0.0:5000 on heroku's severs. I know you had to use the bind method in your previous question to get heroku to work locally, but that method is only covering an issue that isn't resolved.
Using foreman start with web: gunicorn mysite.wsgi should work, as told by the official docs (and my own experince :)).
Try just web: gunicorn mysite.wsgi in your procfile, deploy it to heroku and see if it works.
https://devcenter.heroku.com/articles/python