Forums

ModuleNotFound Error

I have tried many things, but nothing g seems to work. Getting this error in the error log:

Error running WSGI application
2024-10-07 19:45:22,087: ModuleNotFoundError: No module named 'ExerCycleWatts/settings'
2024-10-07 19:45:22,087:   File "/var/www/cyclewatts_pythonanywhere_com_wsgi.py", line 23, in <module>
2024-10-07 19:45:22,087:     application = get_wsgi_application()
2024-10-07 19:45:22,088: 
2024-10-07 19:45:22,088:   File "/home/cycleWatts/.virtualenvs/.venv_exergps/lib/python3.10/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2024-10-07 19:45:22,088:     django.setup(set_prefix=False)
2024-10-07 19:45:22,088: 
2024-10-07 19:45:22,088:   File "/home/cycleWatts/.virtualenvs/.venv_exergps/lib/python3.10/site-packages/django/__init__.py", line 19, in setup
2024-10-07 19:45:22,088:     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2024-10-07 19:45:22,088: 
2024-10-07 19:45:22,089:   File "/home/cycleWatts/.virtualenvs/.venv_exergps/lib/python3.10/site-packages/django/conf/__init__.py", line 89, in __getattr__
2024-10-07 19:45:22,089:     self._setup(name)
2024-10-07 19:45:22,089: 
2024-10-07 19:45:22,089:   File "/home/cycleWatts/.virtualenvs/.venv_exergps/lib/python3.10/site-packages/django/conf/__init__.py", line 76, in _setup
2024-10-07 19:45:22,089:     self._wrapped = Settings(settings_module)
2024-10-07 19:45:22,089: 
2024-10-07 19:45:22,089:   File "/home/cycleWatts/.virtualenvs/.venv_exergps/lib/python3.10/site-packages/django/conf/__init__.py", line 190, in __init__
2024-10-07 19:45:22,089:     mod = importlib.import_module(self.SETTINGS_MODULE)
2024-10-07 19:45:22,090: ***************************************************
2024-10-07 19:45:22,090: If you're seeing an import error and don't know why,
2024-10-07 19:45:22,090: we have a dedicated help page to help you debug: 
2024-10-07 19:45:22,090: https://help.pythonanywhere.com/pages/DebuggingImportError/
2024-10-07 19:45:22,090: ***************************************************

Am I missing a command to start the wsgi?

application = get_wsgi_application()

That's not how you specify the module in Django. If your directory structure is correct and what your code expects, then you would need to use something like ExerCycleWatts.settings

Thanks -- that worked!

Glad to hear that you made it work!