Forums

ModuleNotFoundError: No module named 'juzgado10'

Ive built a webapp using django and wagtail and im having trouble running it on here

This is the error its giving me

2023-04-05 14:22:05,664: Error running WSGI application
2023-04-05 14:22:05,664: ModuleNotFoundError: No module named 'juzgado10'
2023-04-05 14:22:05,665:   File "/var/www/juzgado10_pythonanywhere_com_wsgi.py", line 92, in <module>
2023-04-05 14:22:05,665:     application = get_wsgi_application()
2023-04-05 14:22:05,665: 
2023-04-05 14:22:05,665:   File "/usr/local/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2023-04-05 14:22:05,665:     django.setup(set_prefix=False)
2023-04-05 14:22:05,665: 
2023-04-05 14:22:05,665:   File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 19, in setup
2023-04-05 14:22:05,666:     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2023-04-05 14:22:05,666: 
2023-04-05 14:22:05,666:   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 87, in __getattr__
2023-04-05 14:22:05,666:     self._setup(name)
2023-04-05 14:22:05,666: 
2023-04-05 14:22:05,666:   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 74, in _setup
2023-04-05 14:22:05,666:     self._wrapped = Settings(settings_module)
2023-04-05 14:22:05,666: 
2023-04-05 14:22:05,667:   File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 183, in __init__
2023-04-05 14:22:05,667:     mod = importlib.import_module(self.SETTINGS_MODULE)

and heres the wsgi configuration

import os
import sys
#
## assuming your django settings file is at '/home/juzgado10/mysite/mysite/settings.py'
## and your manage.py is is at '/home/juzgado10/mysite/manage.py'
path = '/home/juzgado10/pagina-juzgado/juzgado10'
if path not in sys.path:
    sys.path.append('/home/juzgado10/pagina-juzgado/juzgado10')

from wsgi import application as application

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
#
## then:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

im really having trouble understanding how to solve this issue, ofc i can see that the issue is that its not importing the module correctly, but still

pls help

Hmm, I'm not sure it's directly related, but are your settings really in the location that you have specified there? The mysite looks wrong. As it's written, it would be looking for either a file like this:

/home/juzgado10/pagina-juzgado/juzgado10/mysite/settings.py

...or a directory containing an __init__.py file at

/home/juzgado10/pagina-juzgado/juzgado10/mysite/settings

The mysite in our default WSGI file is just a placeholder, and should be replaced with the actual name of the directory containing your settings.

Oh okay. Ill try that then! Thanks!