This is the error I'm having:
AsyoucanseeinthelistofURLs,thenumber8isequaltothe"current url" given below.
My url list:
from django.conf.urls import include, url
from django.contrib import admin
from principal.views import IndexView, LogOut, RedirQuiz
urlpatterns = [
url('', include('social.apps.django_app.urls', namespace='social')),
url(r'^admin/', admin.site.urls),
url(r'^$', IndexView),
url(r'^sair/$', LogOut),
url(r'^Quiz/$', RedirQuiz),
]
My view:
from django.shortcuts import render
from django.http import HttpResponse
from django.views.generic import TemplateView
from django.shortcuts import render, redirect
from django.contrib.auth import logout
from django.template import loader
def IndexView(request):
template = 'index.html'
return render(request, template)
def LogOut(request):
logout(request)
return redirect('/')
def RedirQuiz(request):
if request.method == 'POST':
return render('Quizz.html')
return HttpResponse(request(render))
What I want to do is simply redirect a page after user authentication. However, even creating the HTML file to refer to, it knows where the file is, use the correct link, I get this error.