

def register(request, success_url=None, form_class=RegistrationForm, profile_callback=None, template_name='registration/registration_form.html', extra_context=None):
    '\n    Allow a new user to register an account.\n    \n    Following successful registration, issue a redirect; by default,\n    this will be whatever URL corresponds to the named URL pattern\n    ``registration_complete``, which will be\n    ``/accounts/register/complete/`` if using the included URLConf. To\n    change this, point that named pattern at another URL, or pass your\n    preferred URL as the keyword argument ``success_url``.\n    \n    By default, ``registration.forms.RegistrationForm`` will be used\n    as the registration form; to change this, pass a different form\n    class as the ``form_class`` keyword argument. The form class you\n    specify must have a method ``save`` which will create and return\n    the new ``User``, and that method must accept the keyword argument\n    ``profile_callback`` (see below).\n    \n    To enable creation of a site-specific user profile object for the\n    new user, pass a function which will create the profile object as\n    the keyword argument ``profile_callback``. See\n    ``RegistrationManager.create_inactive_user`` in the file\n    ``models.py`` for details on how to write this function.\n    \n    By default, use the template\n    ``registration/registration_form.html``; to change this, pass the\n    name of a template as the keyword argument ``template_name``.\n    \n    **Required arguments**\n    \n    None.\n    \n    **Optional arguments**\n    \n    ``form_class``\n        The form class to use for registration.\n    \n    ``extra_context``\n        A dictionary of variables to add to the template context. Any\n        callable object in this dictionary will be called to produce\n        the end result which appears in the context.\n    \n    ``profile_callback``\n        A function which will be used to create a site-specific\n        profile instance for the new ``User``.\n    \n    ``success_url``\n        The URL to redirect to on successful registration.\n    \n    ``template_name``\n        A custom template to use.\n    \n    **Context:**\n    \n    ``form``\n        The registration form.\n    \n    Any extra variables supplied in the ``extra_context`` argument\n    (see above).\n    \n    **Template:**\n    \n    registration/registration_form.html or ``template_name`` keyword\n    argument.\n    \n    '
    if (request.method == 'POST'):
        form = form_class(data=key.POST, files=request.FILES)
        if form.is_valid():
            new_user = form.save(profile_callback=profile_callback)
            return HttpResponseRedirect((success_url or reverse('registration_complete')))
    else:
        form = form_class()
    if (extra_context is None):
        extra_context = {
            
        }
    context = RequestContext(request)
    for (key, value) in extra_context.items():
        context[key] = ((callable(value) and value()) or value)
    return render_to_response(template_name, {
        'form': form,
    }, context_instance=context)

dataset/ETHPy150Open davemerwin/blue-channel/external_apps/registration/views.py register/VarMisuse@49/876 `request`->`key`