I'm migrating a project made in django 1.7 to django 1.10, when I try to run the project I get the error:
The view core.config.views.home did not return an HttpResponse object. It returned None instead.
So I could understand this and because of the reverse that was discontinued, the view that the error refers to is the following:
@login_required
def home(request):
dados={}
if request.user.has_perm('admin'):
return render(request, 'Template_Error.html',{'mensagem':"Você não possui permissão para Logar no sistema",'titulo':'Aviso!'})
if request.user.has_perm('ava.view_professor'):
return redirect(reverse(viewname='home_professor'))
elif request.user.has_perm('ava.view_aluno'):
return redirect(reverse(viewname='home_aluno'))
What is the correct way to do this today?