문제

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