Advertisement
Darkolius

Untitled

Dec 4th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. class My(UserCreationForm):
  2.  
  3.     def __init__(self, *arg, **kwarg):
  4.         super(My, self).__init__(*arg, **kwarg)
  5.         self.empty_permitted = False
  6.  
  7. def sign_up(request):
  8.     context = {}
  9.     form = My(request.POST or None)
  10.     if request.method == "POST":
  11.         if form.is_valid():
  12.             form.save()
  13.             return render(request, 'accounts/index.html')
  14.  
  15.     context['form'] = form
  16.     return render(request,'registration/sign_up.html', context)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement