Forums

AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'

Hello PythonAnywhere community! I need your help, I'm stuck. I had some problems with setting up Wagtail CMS on PythonAnywhere. From Python version to Django version and problems with "wsgi" files. Now, I solve almost all problems (so far) but this one:

Error log:

2023-10-13 08:09:03,121: AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'
2023-10-13 08:09:03,121:   File "/home/bc4k3xgd/mysite/env/lib/python3.9/site-packages/django/core/handlers/wsgi.py", line 124, in __call__
2023-10-13 08:09:03,121:     response = self.get_response(request)
2023-10-13 08:09:03,121: 
2023-10-13 08:09:03,122:   File "/home/bc4k3xgd/mysite/env/lib/python3.9/site-packages/django/core/handlers/base.py", line 139, in get_response
2023-10-13 08:09:03,122:     set_urlconf(settings.ROOT_URLCONF)
2023-10-13 08:09:03,122: 
2023-10-13 08:09:03,122:   File "/home/bc4k3xgd/mysite/env/lib/python3.9/site-packages/django/conf/__init__.py", line 104, in __getattr__
2023-10-13 08:09:03,122:     val = getattr(_wrapped, name)

So, the one important thing is that I'm novice in Python and Django. I have some knowledge in programming and developing but never used web technologies before. I didn't code for very long time, and I wanted to start my hobby project for myself. I would really appreciate if someone can help me.

P.S. Sorry for my bad english.

Can we take a look at your files? We can see them from our admin interface, but we always ask for permission first.

Yes, of course! You have my permission. :)

You have a directory called settings in your mysite directory and that is where your settings are being imported instead of or ahead of the settings.py file that where you have your configuration. None of the configuration that is in settings.py is being used.

Such a simple problem. Thank you very very much! It works!