首先,我是django和python的初学者 我想注册和登录服务,但我有python语法错误
我使用python3.7.3
from django.shortcuts import render
from django.contrib.auth.models import User
from django.contrib import auth
def signup(request):
if request.method == "POST" :
if request.POST["password1"] == request.POST["password2"] :
user = User.objects.create_user{
username=request.POST["username"], password = request.POST["password"]
if user is not None:
auth.login(request,user)
return redirect['home']
else:
return render(request, 'login.html', {'error': 'username or password is incorrect'})
else:
return render(request,'login.html')
}
在第8行中,(用户=User.objects.create\u用户)我有语法错误 帮助我!你知道吗
你在这里犯错误
试试这个
相关问题 更多 >
编程相关推荐