Advertisement
Guest User

Untitled

a guest
May 21st, 2021
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. def get_name(request):
  2.     # if this is a POST request we need to process the form data
  3.     if request.method == 'POST':
  4.         # create a form instance and populate it with data from the request:
  5.         form = NameForm(request.POST)
  6.         # check whether it's valid:
  7.         if form.is_valid():
  8.             # process the data in form.cleaned_data as required
  9.             # ...
  10.             # redirect to a new URL:
  11.             username = form.cleaned_data['user_user']
  12.             email_user = form.cleaned_data['user_email']
  13.             pass_user = form.cleaned_data['user_pass']
  14.             sender = form.cleaned_data['user_submit']
  15.  
  16.     # if a GET (or any other method) we'll create a blank form
  17.     else:
  18.         form = NameForm()
  19.  
  20.     return render(request, 'registration.html', {'form': form})
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement