Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django not recognizing django admin urls

I just registered my models my models with django admin. I navigate to the django admin at /admin. I log in sucessfully and I can see all my models. great so far.

But now if I try to click one of the links, for Ex: 'users', django gives me a 404 saying

The current URL, admin/auth/user/, didn't match any of these.

Its really weird because in my urls.py I have it mapped correctly

(r'^admin/', include(admin.site.urls)),

I have all the required middleware enabled and have these in my installed apps

'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',

anyone have any idea? Thanks.

like image 572
colorfulgrayscale Avatar asked Dec 08 '25 10:12

colorfulgrayscale


1 Answers

Do you have this one in your urls.py?:

from django.contrib import admin

admin.autodiscover()

But in fact without this you shouldn't even see models from django.contrib.auth... weird, can you post complete urls.py file?

like image 116
dzida Avatar answered Dec 09 '25 23:12

dzida