2
That’s the mistake I’m having:
As you can see in the URLS list the number 8 is equal to the "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 me, it know where the file is, use the correct link, get this error.
You’re at the Stackoverflow in Portuguese, if you do not translate your question, it will be closed. | You’re in Stackoverflow in Portuguese, if you don’t Translate your Question, it’ll be closed.
– Marco Giovanni
Translated......
– cyro buosi