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