Answer the question
In order to leave comments, you need to log in
Why does the redirect work to the wrong page?
weber.html opens not on this page 127.0.0.1:8000/weber, but on this 127.0.0.1:8000/weber/weber/. Why is that?
main urls:
from django.contrib import admin
from django.urls import path
from django.conf.urls import include
urlpatterns = [
path('admin/', admin.site.urls),
path('weber/', include('weber.urls'))
]
from django.urls import path
from weber import views
urlpatterns = [
path('weber/', views.weber, name = 'weber')
]
from django.shortcuts import render
def weber(request):
return render(request, 'weber/weber.html', locals())
Answer the question
In order to leave comments, you need to log in
weber urls
from django.urls import path
from weber import views
urlpatterns = [
path('' , views.weber, name = 'weber')
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question