Forums

something went wrong

when i tried to launch my app from PA's web tab, i got this error " There was an error loading your PythonAnywhere-hosted site. There may be a bug in your code.

Error code: Unhandled Exception "

what is the cause of tis error? yhere are no errors in my web tab/. thanks

adysys

when i check error log, here is what i saw

2017-02-23 20:45:50,599 :  File "/home/Adysys/my-first-blog/myvenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 89, in __init__
2017-02-23 20:45:50,599 :    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
2017-02-23 20:45:51,845 :Error running WSGI application
2017-02-23 20:45:51,846 :ImportError: Could not import settings 'myblog.settings' (Is it on sys.path?): No module named myblog.settings
2017-02-23 20:45:51,846 :  File "/home/Adysys/my-first-blog/myvenv/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 250, in __call__
2017-02-23 20:45:51,846 :    self.load_middleware()
2017-02-23 20:45:51,846 :
2017-02-23 20:45:51,846 :  File "/home/Adysys/my-first-blog/myvenv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 39, in load_middleware
2017-02-23 20:45:51,846 :    for middleware_path in settings.MIDDLEWARE_CLASSES:
2017-02-23 20:45:51,846 :
2017-02-23 20:45:51,847 :  File "/home/Adysys/my-first-blog/myvenv/local/lib/python2.7/site-packages/django/utils/functional.py", line 276, in __getattr__
2017-02-23 20:45:51,847 :    self._setup()
2017-02-23 20:45:51,847 :
2017-02-23 20:45:51,847 :  File "/home/Adysys/my-first-blog/myvenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
2017-02-23 20:45:51,847 :    self._wrapped = Settings(settings_module)
2017-02-23 20:45:51,847 :
2017-02-23 20:45:51,847 :  File "/home/Adysys/my-first-blog/myvenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 89, in __init__
2017-02-23 20:45:51,847 :    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))

[edit by admin: formatting]

Have you taken a look at this help page? It explains how you can debug import errors like that.

yeah i did look at the help page before reporting issue here, did not get a work around.

any other solution would be appreciated

many thanks

OK @Adsys, I'm sure we can get to the bottom of it!

That help page suggests several debugging steps to take. Can you let us know what happens when you run through them?

https://help.pythonanywhere.com/pages/DebuggingImportError

thanks i fixed it

how you fixed it.

how you fixed it.

Hi there, this page has suggestions on how to fix common problems, most people find it solves their problems: https://help.pythonanywhere.com/pages/DebuggingImportError

try that and let us know if you still need help?