#NEWLINE# def create_user( request , post_data , files , backend_name = DEFAULT_BACKEND ) : #NEWLINE# #INDENT# 'Create new user from a distutil client request' #NEWLINE# form = RegistrationForm ( { #NEWLINE# #INDENT# 'username' : post_data [ 'name' ] , #NEWLINE# 'email' : post_data [ 'email' ] , #NEWLINE# 'password1' : post_data [ 'password' ] , #NEWLINE# 'password2' : post_data [ 'password' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( not form . is_valid ( ) ) : #NEWLINE# #INDENT# return HttpResponseBadRequest ( ) #NEWLINE# #UNINDENT# backend = get_backend ( request ) #NEWLINE# if ( not backend . registration_allowed ( request ) ) : #NEWLINE# #INDENT# return HttpResponseBadRequest ( ) #NEWLINE# #UNINDENT# new_user = backend . register ( request , ** form . cleaned_data ) #NEWLINE# return HttpResponse ( 'OK\n' , status = 200 , mimetype = 'text/plain' )