pythondjangodjango-viewsurl-mappingurl-pattern

NoReverseMatch at / 'QuizApp' is not a registered namespace inside 'basic_app'


I want to connect my basic_app with an index.html (index.html of my quiz app) file, which is inside the basic_app folder, but it is situated like this - basic_app/QuizApp/index.html and this problem is probably about the principle of having other folders in my basic_app folder and calling the .html files from there, which is something I am struggling with.

This is my view -

def quizindex(request):
    return render(request,'basic_app/QuizApp/index.html')

This is the corresponding urlpattern -

url(r'^quizindex/$', views.quizindex, name='quizindex'),

And this is the anchor tag situated on my homepage, (main index.html situated like this - basic_app/index.html) which points to the actual index.html of the Quiz - (I am honestly not sure if the following code is written in a right manner)

<a href="{% url 'basic_app:QuizApp:register' %}">QUIZ</a>

How can I fix this error?


Solution

  • You have to call your path name quizindex

    Try this:

    <a href="{% url 'quizindex' %}">QUIZ</a>