Forums

Django and rest applictaion wsgi error

.

python2.7 -i /var/www/chadan_pythonanywhere_com_wsgi.py
Traceback (most recent call last):
File "/var/www/chadan_pythonanywhere_com_wsgi.py", line 15, in <module>
    application = StaticFilesHandler(get_wsgi_application())
File "/home/chadan/.local/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
    django.setup()
File "/home/chadan/.local/lib/python2.7/site-packages/django/__init__.py", line 17, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/home/chadan/.local/lib/python2.7/site-packages/django/conf/__init__.py", line 55, in __getattr__
    self._setup(name)
File "/home/chadan/.local/lib/python2.7/site-packages/django/conf/__init__.py", line 43, in _setup
    self._wrapped = Settings(settings_module)
File "/home/chadan/.local/lib/python2.7/site-packages/django/conf/__init__.py", line 99, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: Import by filename is not supported.

[edit by admin: formatting]

It sounds like you've added a filename to some import code somewhere. As you're using Django, the most likely place is in INSTALLED_APPS in your settings.py. Could you post the code you have there?