Я пытаюсь создать страницу регистрации. Модель и Форма заполнены правильно. Я могу создать и сохранить пользователя в оболочке python, но когда я делаю это на веб-странице, он выдает сообщение об ошибке:
Exception happened during processing of request from ('127.0.0.1', 64590)
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 720, in __init__
self.handle()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/servers/basehttp.py", line 171, in handle
self.handle_one_request()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/servers/basehttp.py", line 179, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 54] Connection reset by peer
Функция регистрации View.py:
def register(request,id):
form = RegisterForm(request.POST or None)
if form.is_valid():
username = form.cleaned_data.get("username")
name=form.cleaned_data.get("name")
password = form.cleaned_data.get("password")
email=form.cleaned_data.get["email"]
newUser1=user(username=username)
newUser1.set_password(password)
newUser1.save()
print(newUser1)
login(request,newUser1)
messages.info(request,"Başarıyla Kayıt Oldunuz...")
return redirect("PatchPanel")
context = {
"form" : form,
"id":id
}
return render(request,"SignupLogin.html",context)