[Python] Django url pathing, home url always overwriting path('', views.home, name='home')

Discussão em 'Python' iniciado por Stack, Fevereiro 5, 2025.

  1. Stack

    Stack Membro Participativo

    from django.urls import path
    from . import views

    urlpatterns = [
    path('signup/', views.signup, name='signup'),
    path('', views.home, name='home'),

    ]


    this is my code for the URLs under my something I call timetable

    from django.contrib import admin
    from django.urls import path, include

    urlpatterns = [
    path('admin/', admin.site.urls),
    path('signup/' , include('timetable.urls')),
    path('', include('timetable.urls')),
    ]


    this is the code for the main urls.py

    so I know that the call to the other url.py works as if I take the '' (home) URL out it redirects to the right URL (the view that I have in place) but if I have the home URL in it just always goes straight to that URL, is there any way like in react where I can do Exact or do you guys know of any solution for this that is simple

    Continue reading...

Compartilhe esta Página