Complete the code to import the UserCreationForm from Django's auth forms.
from django.contrib.auth.forms import [1]
The UserCreationForm is the built-in form for user registration in Django.
Complete the view function to instantiate the UserCreationForm with POST data.
form = [1](request.POST or None)
To process user registration data, instantiate UserCreationForm with request.POST.
Fix the error in the form validation check in the view.
if form.[1]():
The correct method to check if a form is valid is is_valid().
Fill both blanks to save the new user and redirect after successful registration.
if form.is_valid(): user = form.[1]() return redirect('[2]')
Call save() on the form to create the user, then redirect to the home page.
Fill all three blanks to complete the registration view with form rendering and POST handling.
def register(request): if request.method == '[1]': form = UserCreationForm(request.POST) if form.is_valid(): form.[2]() return redirect('[3]') else: form = UserCreationForm() return render(request, 'register.html', {'form': form})
The view checks if the request method is 'POST' to process the form, calls save() to create the user, and redirects to 'home'.