404 Django Python Error

1

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.

    
asked by anonymous 09.11.2016 / 16:54

1 answer

4

Switch

 url(r'^Quiz/$', RedirQuiz),

by

 url(r'Quiz/$', RedirQuiz),

Or

url(r'complete/facebook/Quiz/?$),

The characters ^ and $ are special.

The first (^) says that the combination should START and the second ($) should END.

    
09.11.2016 / 17:43