Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class My(UserCreationForm):
- def __init__(self, *arg, **kwarg):
- super(My, self).__init__(*arg, **kwarg)
- self.empty_permitted = False
- def sign_up(request):
- context = {}
- form = My(request.POST or None)
- if request.method == "POST":
- if form.is_valid():
- form.save()
- return render(request, 'accounts/index.html')
- context['form'] = form
- return render(request,'registration/sign_up.html', context)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement