Answer the question
In order to leave comments, you need to log in
What causes a 404 error in django?
Gives an error on startup
#mysite - urls
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('train/', include('train.urls')),
path('', include('main.urls')),
]
#train-urls
from django.urls import path
from . import views
urlpatterns = [
path('train/', views.train),
]
#train-views
from django.shortcuts import render
# Create your views here.
def train(request):
return render(request, 'train/train.html')
Answer the question
In order to leave comments, you need to log in
You have both urls.py written in such a way that the request must be to the address/train/train/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question