[Fixed]-No web processes running Django in heroku

34👍

Benjamin Manns’ solution worked for me, though I needed one additional step as well.

According to this, after the Procfile solution has been pushed, run the following:

heroku ps:scale web=1

website should load correctly now.

for more help pushing to a heroku git repo, see this

👤ecoe

14👍

Add proc file and run following command

$ heroku ps:scale web=1

9👍

Have you gone through the Heroku guide for setting up a Django application? What does your Procfile look like?

Your project should have a file named Procfile that should have contents similar to

web: gunicorn hellodjango.wsgi

4👍

Your Procfile must look like this (for python):

web: python myApp.py runserver 0.0.0.0:$PORT

4👍

If you are in python/django

heroku logs --tail

if you are unable to find the bug and fix then try doing,

First Run to see whether its working in herokus local

heroku local web

Mine was to specify the path of django wsgi.py file in Procfile

see their example https://github.com/heroku/python-getting-started

The Procfile will look similar to this

web: gunicorn projectname.wsgi --log-file -

You may have to install gunicorn if not installed and add it to requirements.txt

Then Git add and commit, after that push to heroku

git push heroku master

Then scale your app

heroku ps:scale web=1

1👍

I did the following steps to make it work.

1) I had to move my Procfile to the outermost folder.

2) Then I had to change my Procfile to

web: gunicorn projectname.projectname.wsgi

3) Also in my wsgi file I had to change my settings path to

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'projectname.projectname.settings')

4) In my settings.py file I had to change my ROOT_URLCONF

ROOT_URLCONF = 'projectname.projectname.urls'

5) In urls.py I had to change my path to

from projectname.applicationname import urls as app_urls

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include(app_urls)),
]

6) Finally I did

git push heroku master
heroku ps:scale web=1

After making all these changes heroku worked like a charm. But it doesn’t work locally on windows because I read somewhere windows doesn’t have gunicorn.

When I tried python projectname/manage.py runserver locally it said

ModuleNotFoundError: No module named 'projectname.projectname'

So for running it locally I’ve to revert all the steps above 😛

0👍

in my case it was dynos configuration error,i meant to say that if u re not premium member see whether dynos available for your app from heroku dashbord. this u can check by clicking on metrics,if you don’t have one estimate it.
run command
$ heroku ps:scale web=1
push your code in master.

👤akhil

0👍

I was getting application error
I checked heroku logs –tail , in desc="No web processes running"
Mostly this occur due to Procfile, so inside Procfile I forgot to give space after "web:"

web: gunicorn hellodjango.wsgi --log-file - 

so check your Procfile{this file is to be created in root folder just inside project folder}

0👍

Though it is already said but please do a check if the Procfile, runtime.txt and requirements.txt are in the outermost folder. (These files will be placed in the location of manage.py)

0👍

My case was a little different. I had settled up everything and deployed my app on Heroku. I have deployed 3 4 python apps on Heroku previously. had Procfile and requirements.txt in root folder.

This time, I tried almost the whole every guide and StackOverflow answers but found nothing. Then just added a space after web: and gunicorn and it worked perfectly.

previously I was using web:gunicorn wsgi:app

I just changed that to web: gunicorn wsgi:app and It worked like a charm

0👍

enter image description here

Make sure your dynos is running otherwise you will get this above error also.
and then you have to manually start dynos on heroku, while heroku automatically start that for you but some time you have to do run manually on heroku.
Click on a Configure dynos button ==> toggle the dynos button and your dynos will start.

0👍

Check your dyno’s configuration in the Heroku dashboard. It might be the wrong app name before the wsgi module. I had an old project’s app name instead of the one I tried to use:

web: gunicorn old_project_app.wsgi

Correct your Procfile and push it to Heroku. You might need to delete and recreate the file. It should then be like this in the dyno config:

web: gunicorn new_project_app.wsgi

-1👍

Make sure the spelling of the Procfile. Its supposed to be "Procfile" and not "procfile"

Leave a comment