0

I have a Django application running an older version Django-Registration. In that application, I'm overriding the normal registration form with a custom one that I have created like so:

from myApp.forms import extendedRegistrationForm

# using my registration form to override the default
url (
    r'^accounts/register/$', 
    'registration.views.register',
    {
        'form_class': extendedRegistrationForm,
        'backend': 'registration.backends.default.DefaultBackend',
    }
),    

It works fine. However, I am now migrating to the current version of Django-registration which I'm told does not have a view named registration.views.register. Instead it has a class-based view RegistrationView. So I get the following error:

Could not import registration.views.register. View does not exist in module registration.views.

Can someone show me how to adapt my code above to work with RegistrationView?

Saqib Ali
  • 11,931
  • 41
  • 133
  • 272

1 Answers1

2

Try

from registration.views import RegistrationView

register = RegistrationView.as_view()

url (
    r'^accounts/register/$', 
    register,
    {
        'form_class': extendedRegistrationForm,
        'backend': 'registration.backends.default.DefaultBackend',
    }
),  
elssar
  • 5,651
  • 7
  • 46
  • 71
  • Actually, I spoke too soon. Sorry. It didn't really work. The error I posted went away. But the over-riding the registration is no working correctly. See my new post here: http://stackoverflow.com/questions/20738954/how-to-over-ride-default-registration-form-in-django-registration-version-1-0 – Saqib Ali Dec 23 '13 at 07:33
  • I think [this](http://stackoverflow.com/a/20739672/805427) answer should solve your problem. – elssar Dec 23 '13 at 09:54