I am using Django 1.3 and django-registration 0.8. I am trying to use the RegistrationFormUniqueEmail
class to enforce unique emails.
The form validation works but once the form is submitted, it does not load the registration_complete.html
template. The page refreshes, and the url goes to register/complete
, but it just displays an empty registration_form.html
template.
I suspect my urls.py is incorrectly configured:
from registration.forms import RegistrationFormUniqueEmail
urlpatterns = patterns('',
url(r'^accounts/register/', 'registration.views.register', {'form_class':RegistrationFormUniqueEmail,'backend':'registration.backends.default.DefaultBackend' }),
url(r'^accounts/', include('registration.urls')),
Any suggestions? I'd prefer not to upgrade Django.
Try adding a $
to the end of your first regex. At the moment, it matches both /accounts/register/
and /accounts/register/complete/
.
url(r'^accounts/register/$', 'registration.views.register', {'form_class':RegistrationFormUniqueEmail,'backend':'registration.backends.default.DefaultBackend' }),