[Python] Reverse for "not found." is not a valid view or function name error [closed]

Discussão em 'Python' iniciado por Stack, Maio 15, 2025.

  1. Stack

    Stack Membro Participativo

    I am working on my major project for software engineering in highschool and I keep coming up with this error when I run my Django project.

    I followed the tutorials set out by my teacher but I still don't know what's going on.

    This is the error message that keeps coming up.


    Reverse for "not found." is not a valid view or function name.
    ​

    This is my project urls.py file

    """
    Software_Engineering_Major_Project URL Configuration

    The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/

    Examples:
    Function views
    1. Add an import: from my_app import views
    2. Add a URL to urlpatterns: path('', views.home, name='home')
    Class-based views
    1. Add an import: from other_app.views import Home
    2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
    Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
    """


    from django.urls import path,include
    import Dark_Library_store.Urls

    urlpatterns = [
    path('',include('Dark_Library_store.Urls')),
    ]


    This is my app Urls.py

    from django.urls import path
    from . import views

    urlpatterns = [
    path('', views.index, name='index'),
    path('store/', views.Store, name='store'),
    path('featured/', views.Featured, name='featured'),
    path('cart/', views.Cart, name='cart'),
    path('contact/', views.Contact, name='contact'),
    path('login/', views.Login, name='login'),
    path('sign_up/', views.Sign_up, name='sign_up'),
    ]


    This is my views.py file

    from django.shortcuts import render
    import os
    from . import views



    def index(request):
    return render(request, 'Dark_Library_store/index.html')

    def Store(request):
    return render(request, 'Dark_Library_store/Store.html')

    def Featured(request):
    return render(request, 'Dark_Library_store/Featured.html')

    def Cart(request):
    return render(request, 'Dark_Library_store/Cart.html')

    def Contact(request):
    return render(request, 'Dark_Library_store/Contact.html')

    def Login(request):
    return render(request,'Dark_Library_store/Login.html')

    def Sign_up(request):
    return render(request, 'Dark_Library_store/Sign_up.html')


    Any help with this will be very appreciated

    Continue reading...

Compartilhe esta Página