When creating the web application, I chose python 3.4 and no virtualenv.
My wsgi file (/var/www/clown_pythonanywhere_com_wsgi.py) looks like this:
import sys
path = '/home/clown/LatticeAnimals/counting_site/counting_site/'
if path not in sys.path:
sys.path.append(path)
from wsgi import application
Application directory structure is (showing only relevant parts):
/home/clown/LatticeAnimals/counting_site/
/home/clown/LatticeAnimals/counting_site/manage.py
/home/clown/LatticeAnimals/counting_site/counting_site/
/home/clown/LatticeAnimals/counting_site/counting_site/settings.py
/home/clown/LatticeAnimals/counting_site/counting_site/wsgi.py
/home/clown/LatticeAnimals/counting_site/counting_app/
Content of wsgi.py:
"""
WSGI config for counting_site project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "counting_site.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Full stack trace of error:
2016-03-27 18:36:05,597 :Traceback (most recent call last):
2016-03-27 18:36:05,598 : File "/usr/local/lib/python3.4/dist-packages/django/conf/__init__.py", line 128, in __init__
2016-03-27 18:36:05,598 : mod = importlib.import_module(self.SETTINGS_MODULE)
2016-03-27 18:36:05,598 : File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
2016-03-27 18:36:05,598 : return _bootstrap._gcd_import(name[level:], package, level)
2016-03-27 18:36:05,598 : File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
2016-03-27 18:36:05,599 : File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
2016-03-27 18:36:05,599 : File "<frozen importlib._bootstrap>", line 2212, in _find_and_load_unlocked
2016-03-27 18:36:05,599 : File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
2016-03-27 18:36:05,599 : File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
2016-03-27 18:36:05,599 : File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
2016-03-27 18:36:05,600 : File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
2016-03-27 18:36:05,600 :ImportError: No module named 'counting_site'
2016-03-27 18:36:05,600 :
2016-03-27 18:36:05,600 :During handling of the above exception, another exception occurred:
2016-03-27 18:36:05,600 :
2016-03-27 18:36:05,600 :Traceback (most recent call last):
2016-03-27 18:36:05,600 : File "/bin/user_wsgi_wrapper.py", line 138, in __call__
2016-03-27 18:36:05,601 : self.error_log_file.logger.exception("Error running WSGI application")
2016-03-27 18:36:05,601 : File "/usr/lib/python3.4/logging/__init__.py", line 1310, in exception
2016-03-27 18:36:05,601 : self.error(msg, *args, **kwargs)
2016-03-27 18:36:05,601 : File "/usr/lib/python3.4/logging/__init__.py", line 1303, in error
2016-03-27 18:36:05,602 : self._log(ERROR, msg, args, **kwargs)
2016-03-27 18:36:05,602 : File "/usr/lib/python3.4/logging/__init__.py", line 1409, in _log
2016-03-27 18:36:05,602 : self.handle(record)
2016-03-27 18:36:05,603 : File "/usr/lib/python3.4/logging/__init__.py", line 1418, in handle
2016-03-27 18:36:05,603 : if (not self.disabled) and self.filter(record):
2016-03-27 18:36:05,603 : File "/usr/lib/python3.4/logging/__init__.py", line 706, in filter
2016-03-27 18:36:05,604 : for f in self.filters:
2016-03-27 18:36:05,604 : File "/bin/user_wsgi_wrapper.py", line 130, in __call__
2016-03-27 18:36:05,604 : app_iterator = self.app(environ, start_response)
2016-03-27 18:36:05,604 : File "/usr/local/lib/python3.4/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__
2016-03-27 18:36:05,604 : self.load_middleware()
2016-03-27 18:36:05,604 : File "/usr/local/lib/python3.4/dist-packages/django/core/handlers/base.py", line 44, in load_middleware
2016-03-27 18:36:05,605 : for middleware_path in settings.MIDDLEWARE_CLASSES:
2016-03-27 18:36:05,605 : File "/usr/local/lib/python3.4/dist-packages/django/conf/__init__.py", line 54, in __getattr__
2016-03-27 18:36:05,605 : self._setup(name)
2016-03-27 18:36:05,605 : File "/usr/local/lib/python3.4/dist-packages/django/conf/__init__.py", line 49, in _setup
2016-03-27 18:36:05,605 : self._wrapped = Settings(settings_module)
2016-03-27 18:36:05,605 : File "/usr/local/lib/python3.4/dist-packages/django/conf/__init__.py", line 132, in __init__
2016-03-27 18:36:05,605 : % (self.SETTINGS_MODULE, e)
2016-03-27 18:36:05,605 :ImportError: Could not import settings 'counting_site.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named 'counting_site'