this is my main urls.py
urlpatterns = [
path('admin/', admin.site.urls),
path('', include("shop.urls")),
]
i want that any url enter by user it will redirect to shop.urls and find here.
like if user enter /index it will search index in shop.urls not in main urls
my shop.urls
from django.urls import path
from . import views
urlpatterns = [
path('', views.index),
path('index', views.index),
]
>Solution :
You need to add / at the end of route so:
urlpatterns = [
path('', views.index),
path('index/', views.index),
]
Then enter the requested url as http://127.0.0.1:8000/index/
