Forums

Error running WSGI application

I could not solve this problem. How do I access it?

2019-04-04 04:00:50,429: Error running WSGI application
2019-04-04 04:00:50,446: django.core.exceptions.ImproperlyConfigured: The app module <module 'bookmark' (namespace)> has multiple filesystem locations (['/home/limchyo/bookmark/bookmark', './bookmark', '/home/limchyo/bookmark']); you must configure this app with an AppConfig subclass with a 'path' class attribute.
2019-04-04 04:00:50,446:   File "/var/www/limchyo_pythonanywhere_com_wsgi.py", line 26, in <module>
2019-04-04 04:00:50,446: 
2019-04-04 04:00:50,446:   File "/home/limchyo/bookmark/venv/lib/python3.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
2019-04-04 04:00:50,447:     django.setup(set_prefix=False)
2019-04-04 04:00:50,447: 
2019-04-04 04:00:50,447:   File "/home/limchyo/bookmark/venv/lib/python3.7/site-packages/django/__init__.py", line 27, in setup
2019-04-04 04:00:50,447:     apps.populate(settings.INSTALLED_APPS)
2019-04-04 04:00:50,447: 
2019-04-04 04:00:50,448:   File "/home/limchyo/bookmark/venv/lib/python3.7/site-packages/django/apps/registry.py", line 85, in populate
2019-04-04 04:00:50,448:     app_config = AppConfig.create(entry)
2019-04-04 04:00:50,448: 
2019-04-04 04:00:50,448:   File "/home/limchyo/bookmark/venv/lib/python3.7/site-packages/django/apps/config.py", line 110, in create
2019-04-04 04:00:50,448:     return cls(entry, module)
2019-04-04 04:00:50,449: 
2019-04-04 04:00:50,449:   File "/home/limchyo/bookmark/venv/lib/python3.7/site-packages/django/apps/config.py", line 40, in __init__
2019-04-04 04:00:50,449:     self.path = self._path_from_module(app_module)
2019-04-04 04:00:50,449: 
2019-04-04 04:00:50,450:   File "/home/limchyo/bookmark/venv/lib/python3.7/site-packages/django/apps/config.py", line 73, in _path_from_module
2019-04-04 04:00:50,450:     "with a 'path' class attribute." % (module, paths))

What code do you have in your WSGI file?

I have same issue. any solve

Could you post the contents of your WSGI file, and the exact error message that you're getting?

I am having a problem in the configuration. Here is the error log:

https://www.pythonanywhere.com/user/iain396/files/var/log/iain396.pythonanywhere.com.error.log

This is my wsgi app:

https://www.pythonanywhere.com/user/iain396/shares/a659a499e1254ef39e9263874f7654e3/

I am on a Udemy Python and Django Full Stack Web Devt Course and this is project work.

By calling chdir(path) in your wsgi file, you are implicitly adding path to the sys.path and that means that Django finds 2 ways to import your each of your Django apps and it cannot decide which one you want. Remove the chdir and that should fix the error.

Hi Glenn, On your advice I removed the chdir, and based on the error log I allowed the pythonanywhere hosting in settings.py and all is working now. Thank you so much for that!

Excellent, glad we could help!

Hi Glenn, I am having the same issue as above. I tried the above solution but still not working for me. Any other suggestions?

Could you post the contents of your WSGI file, and the exact error message that you're getting?

How can I configure this app with an AppConfig subclass with a 'path' class attribute?

This Django documentation page covers how to create AppConfig sunclasses and then you just need to add path as an attribute to your subclass.