Forums

Django-todo app giving unhandled exception

I'm trying to load mezzanine.pythonanywhere.com and once i update the wsgi page with my app name... the tutorial says to reload with the big button at top and my app just says "unhandled exception" no other codes, line errors or anything.

Today this has been a two hour install of what your tutorial calls 15:11, helpful but i'm at a dead end.

https://www.youtube.com/watch?v=Y4c4ickks2A

hi there- to clarify, that is not an official tutorial of ours.

when you see the unhandled exception message, you should check your error logs. Taking a look at your error log, it seems like there is an import error.

Check out this help page about import errors!

Hi Conrad, umm, while I appreciate the feedback of "you have an import error" that doesn't have any contextual meaning to me "as a new user" nor is there a refresh your import or some kind of obvious error.

I don't know how to solve it, nor do I know where to look.

Am I supposed to upload or import data that I am missing if I am missing it how would I know to know what I need to know unless someone like you says "hey, you forgot to import the yadda yadda files and your blueberry.settings.py file doesn't have a special.dude file"

ok- taking a look at your error log, the most recent error message is:

2018-05-01 16:45:23,152: ***************************************************
2018-05-01 17:33:21,379: Error running WSGI application
2018-05-01 17:33:21,403: ImportError: No module named settings
2018-05-01 17:33:21,403:   File "/var/www/mezzanine_pythonanywhere_com_wsgi.py", line 47, in <module>
2018-05-01 17:33:21,403:     application = get_wsgi_application()
2018-05-01 17:33:21,403: 
2018-05-01 17:33:21,403:   File "/home/mezzanine/.virtualenvs/myenv/local/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
2018-05-01 17:33:21,404:     django.setup(set_prefix=False)
2018-05-01 17:33:21,404: 
2018-05-01 17:33:21,404:   File "/home/mezzanine/.virtualenvs/myenv/local/lib/python2.7/site-packages/django/__init__.py", line 22, in setup
2018-05-01 17:33:21,404:     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2018-05-01 17:33:21,404: 
2018-05-01 17:33:21,404:   File "/home/mezzanine/.virtualenvs/myenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
2018-05-01 17:33:21,404:     self._setup(name)
2018-05-01 17:33:21,404: 
2018-05-01 17:33:21,405:   File "/home/mezzanine/.virtualenvs/myenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
2018-05-01 17:33:21,405:     self._wrapped = Settings(settings_module)
2018-05-01 17:33:21,405: 
2018-05-01 17:33:21,405:   File "/home/mezzanine/.virtualenvs/myenv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 110, in __init__
2018-05-01 17:33:21,405:     mod = importlib.import_module(self.SETTINGS_MODULE)
2018-05-01 17:33:21,405: ***************************************************
2018-05-01 17:33:21,405: If you're seeing an import error and don't know why,
2018-05-01 17:33:21,406: we have a dedicated help page to help you debug: 
2018-05-01 17:33:21,406: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-05-01 17:33:21,406: ***************************************************

What this means is that we (the WSGI file) can't find your settings.py module/file. The reason why we can't find it is most likely that in your wsgi.py, you do not have the correct path & DJANGO_SETTINGS_MODULE variable set correctly.

Without really delving into your code and reading the files etc, the closest I can say is:

Let's say your settings.py file is at

/home/mezzanine/mysite/mysite/settings.py

Then the path that you are appending to sys.path should be

/home/mezzanine/mysite/

And the DJANGO_SETTINGS_MODULE environment variable should be

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