Creating a user
When the user submits the signup form, we will have to handle the request and create a user in admin. Use the following steps to do so:
- Add the following in bold in
/accounts/views.py
:from django.shortcuts import render from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django.contrib.auth import login from django.shortcuts import redirect def signupaccount(request): if request.method == 'GET': return render(request, 'signupaccount.html', {'form':UserCreationForm}) else: if request.POST['password1'] == request.POST['password2...