[Answer]-Unable to access /admin/ in Django app

1👍

There are a lot of reasons of this exception. This in my example of urls.py. Most likely that you forgot to add the admin URL at urls.py.

from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.conf.urls.static import static
from django.contrib import admin

admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'^admin/', include(admin.site.urls)),
)

You need to add the Admin URL first to make the admin work. :D.

0👍

please import admin to urls.py file from django.contrib import admin then it will work

Leave a comment