Pythonanywhere - Error code: Unhandled Exception

5.5k views Asked by At

Using Python 2.7 and Django 1.10.4, I was trying to deploy my app to pythonanywhere, but I keep getting this error.

enter image description here

Error Log enter image description here

wsgi.py

import os
import sys

path = '/home/hellcracker/First-Blog'  
if path not in sys.path:
    sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

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

I can't tell where the error is coming from.

Any help would be appreciated!

2

There are 2 answers

0
David Whitlock On

First of all, check the link give in the error log - https://help.pythonanywhere.com/pages/DebuggingImportError/ You could also search for 'from django core wsgi no module named wsgi'. There are many answers already, and I think you should be able to find the answer to your problem there.

0
Shubhankar Dimri On

Make sure that your project name is "mysite" if not update this line

os.environ['DJANGO_SETTINGS_MODULE'] = '<your-project-name>.settings'

Project name will be the directory name parent to your app name, see that in your local machine.