Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
from django.contrib.auth.models import User
from django.contrib.auth import login, authenticate
from django.shortcuts import render, redirect
def register(request):
if request.method == 'POST':
username = request.POST['username']
password = request.POST['password']
email = request.POST['email']
User.objects.create_user(username=username, password=password, email=email)
return redirect('login')
return render(request, 'register.html')