Error running WSGI application

2016-07-27 02:38:54,358 :Error running WSGI application Traceback (most recent call last): File "/bin/", line 154, in call app_iterator =, start_response) File "/bin/", line 170, in import_error_application raise e ImportError: No module named wsgi

Hi there,

Make sure you have the right version of django? Going to your website, it seems like you have solved this problem and you are onto the next one?



How did this problem been solved? I've gotten the same error in my flask application.


Can any PythonAnyWhere staff help to answer this topic?

The django version mismatch I mentioned is in the For django 1.7+, this is correct:

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

for django <1.7, this is correct:

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

For flask, you want to import your app (ie. the app = Flask(__name__) that you have somewhere) and then save it as application in your

This is the settings that worked for me - this goes in your WSGI configuration file.

if path not in sys.path:

from django.core.wsgi import get_wsgi_application
from django.contrib.staticfiles.handlers import StaticFilesHandler
application = StaticFilesHandler(get_wsgi_application())

Hi, can u please check this up for my site: Getting the following error msg: Error running WSGI application OSError: write error GeneratorExit

Those are safe to ignore:

A clarification -- those errors are normally safe to ignore, if you're only seeing them occasionally. If you're seeing lots of them (say, one per second) then it may be a signal that your web app is running too slowly. This could be caused by many different things -- a frequent cause is if you write a view that, when it is accessed, it makes a request to an external site, and that external site is running slowly. Or it could be a bug elsewhere in your code making it do an infinite loop -- or something like that.

ImportError: No module named django.core.wsgi

I see your web app is using a virtualenv. Have you installed Django into the env?


Can I take a look at your files? We can see them from our admin interface, but we always ask for permission first.



You've somehow created a virtualenv that has both Python 3.5 and 2.7 packages installed and you've only installed Django into the 3.5 version where your web app is using 2.7.

So, What I need to do?

Recreate your virtualenv with only Python 2.7 and with Django installed.

If you can. Please do it for me I am very thankful of you please make it live.

We're glad to help you work out what you did wrong and what you need to do to fix it, but we don't do it for you.

i have done but still getting error.

What error?

wsgi error

What is the actual error? "wsgi error" could mean anything.

Error running WSGI application 2017-09-01 14:56:10,093: ImportError: No module named django.core.wsgi 2017-09-01 14:56:10,093: File "/var/www/", line 60, in <module> 2017-09-01 14:56:10,093: from django.core.wsgi import get_wsgi_application

it shows same error line 60 if there is only 16 or 17 line of code.

That error is from 3 days ago. I'm pretty sure it's not useful for the current issue.

means what ???

Hi there, just picking up on this while Glenn is elsewhere. We have some debugging tips for common problems with imports here:

Can I ask you to try them out and report back what you discover?

ImportError: No module named 'django' and also error running vsgi application.

ImportError: No module named 'django' and also error running Wsgi application.

ImportError: No module named 'django' and also error running Wsgi application.

Are you using a virtualenv? If so, have you specified it on the "Web" tab? And have you installed Django into the env?