Django Registration Administrator

I tried Django-registration, see this guide to create a complete login system.

In the tutorials (see STEP 4), I need to update the urls.py file to:

from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/(.*)', admin.site.root), (r'^accounts/', include('registration.urls')), (r'^$', direct_to_template, { 'template': 'index.html' }, 'index'), ) 

But when I do this, the admin page is not available. When i accidentally

 (r'^admin/(.*)', admin.site.root) 

in

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

Admin work; I could log in, but I could not click on anything ... So I could not see the registered users.

What am I doing wrong?

+4
source share
2 answers

You should use:

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

See the documentation .

+3
source

admin.site.root deprecated in Django 1.1, see release notes .

You could not click on anything because there are no links in the admins? If so, you must log in as a superuser .

Also registration.urls deprecated. The new version of django-registration is a complete redesign of the previous code base and increased flexibility, so it is recommended to use the version from the repository. It has a quick start guide .

+2
source

All Articles