Ошибка NoReverseMatch на "url" в Django при запросе AJAX url

Я пытаюсь обновить данные таблицы на HTML странице Django, не обновляя всю страницу каждые 10 секунд... для чего я использую AJAX в Django

Это HTML страница, которую я хочу отобразить -

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>temp1</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
    <h1>Hello there</h1>
    <h1>{{info_data}}</h1>

    <table id="_appendHere" class="table table-striped table-condensed">
        <tr>
          <th>Username</th>
          <th>Email</th>
          <th>Gender</th>
        </tr>
        {% for item in info_data %}
          <tr><td>{{item.username}} - {{item.email}} - {{item.gender}}</td></tr>
        {% endfor %}
      </table>

</body>

<script>

    var append_increment = 0;
    setInterval(function() {
        $.ajax({
            type: "GET",
            url: {% url 'App1:temp' %},  // URL to your view that serves new info
        })
    }, 10000)
</script>

</html>

Я создал модель внутри приложения под названием "App1", данные которого я передаю в эту таблицу, используя этот код -

from django.shortcuts import render
from App1.models import Info

# Create your views here.
def tempPage(request):
    
    info_data=Info.objects.all()
    context={"info_data":info_data}
    return render(request,"App1/temp1.html",context)

Это urls.py для App1 -

from django.contrib import admin
from django.urls import path,include
from App1 import views
app_name = 'App1'

urlpatterns = [
    path('temp/', views.tempPage,name="tempPage"),
]

Но я получаю эту ошибку на URL http://localhost:8000/temp/ -

NoReverseMatch at /temp/
Reverse for 'temp' not found. 'temp' is not a valid view function or pattern name.

Я не уверен, где я ошибаюсь

Я даже добавил пространство имен для приложения и включил его в url часть AJAX запроса "App1:temp"

Но это дает ту же ошибку

Структура проекта -

enter image description here

Любая помощь будет очень признательна!!! Спасибо!!!

У вас опечатка в url измените temp на tempPage

<script>

    var append_increment = 0;
    setInterval(function() {
        $.ajax({
            type: "GET",
            url: {% url 'App1:tempPage' %},  // URL to your view that serves new info
        })
    }, 10000)
</script>
Вернуться на верх