Вопрос

I have boilerplate code in my urls.py, taken from http://www.michelepasin.org/blog/2011/01/14/setting-up-django-registration/:

                   url(r'^activate/(?P<activation_key>w+)/$',
                       activate,
                       { 'backend': 'registration.backends.default.DefaultBackend' },
                       name='registration_activate'),
                   url(r'^register/$',
                       register,
                       { 'backend': 'registration.backends.default.DefaultBackend' },
                       name='registration_register'),

This is crashing because I haven't defined or imported activate, and I expect it to raise similar issues about register.

How can I satisfy or adapt things so that the urlpatterns above will work?

Thanks,

Это было полезно?

Решение

You've misread that page. Those aren't lines you add to your urlconf, they are already defined in django-registration's urls.py. You just need to include them as shown in step 4:

(r'^accounts/', include('registration.urls')),
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top