[Django]-Cannot solve an AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF' conundrum after doing a lot of research

7👍

Yuck. You’re doing all sorts of things in settings.py that should not be done there. You’re importing urls and adding to them, and importing the admin and registering a model. Both of these actions rely on settings already being set up, so it’s not surprising Django is getting confused.

Remove all those imports (except os), and move the URL modification to urls.py and the admin registration to the relevant admin.py.

Leave a comment