Cant find sub pages 404

Hey,

If I want to enter a sub page like 127.0.0.1:8000/dashboard, django is searching for the page in my project folder instead of the place where it is. But the normal index page works.

This is my error message:

“D:\Developement\Projekte\Niloom\dashboard” does not exist
Not Found: /dashboard

This is my urls:


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


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

and this is the urls.py in my app:

from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from django.urls import path
from . import views
 
app_name = 'home'
urlpatterns = [
    path('', views.index_view, name="index"),
    path('dashboard/', views.dashboard_view, name="dashboard"),

]

urlpatterns = urlpatterns+static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT)

views:

def index_view(request):

    return render(request, 'home/index.html')

def dashboard_view(request):

    return render(request, 'home/dashboard.html')

url_rootconfig:

ROOT_URLCONF = 'Niloom.urls'

The url in your urls.py file has a trailing slash (/), but the url you’re showing does not have that. Try going to dashboard/

Also see Settings | Django documentation | Django