Indentation is important in Python. It should be:
from django.shortcuts import render
def Register(request):
if request.method == 'POST':
else:
return render(request,"Register.html")
Removing all the redundant blank lines makes it clearer. But a better option would be to change the
if
test, and remove the
else
.
from django.shortcuts import render
def Register(request):
if request.method != 'POST':
return render(request,"Register.html")