def activate(request, activation_key, template_name='registration/activate.html', extra_context=None):
 activation_key = activation_key.lower()
 account = RegistrationProfile.objects.activate_user(activation_key)
 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, {'account': account, 'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS}, context_instance=context)

def activate ( request , activation_key , template_name = 'registration/activate.html' , extra_context = None ) : activation_key = activation_key . lower ( ) account = RegistrationProfile . objects . activate_user ( activation_key ) 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 , { 'account' : account , 'expiration_days' : settings . ACCOUNT_ACTIVATION_DAYS } , context_instance = context )
activate a users account from an activation key .