PythonAnywhere Forums

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())