I’m using django-registration app to perform registration. After registration (no matter if successful or not), I’d like to return to whatever page the registation app would redirect, but I want to pass a login form to that template.
Something like this:
def register(request):
registered = reg_views.register(request, backend='registration.backends.default.DefaultBackend', template_name='zzz/index.html')
login_form = AuthenticationForm()
return render_to_response(registered, { 'login_form': login_form })
and then in the template have the ussual:
{{ login_form.as_p }}
Here’s what I am trying to achieve:
I want to leverage the functionality of the registration app. However, after a (un)successful registration, I need to be able to display the login form on the page. This login form should be passed from the view (DRY principle).
Thanks,
Matyas
urls.py
new urls.py
With this set, you can copy the register view somewhere on your code from the registration app, and modify it as you please, without having to modify the app it self. The register view is pretty straight forward so you will have no problem making some changes.