Answer the question
In order to leave comments, you need to log in
How to pass two parameters to urls.py/views.py?
How to properly pass two url parameters to a view in Django 2?
Wrote like this:
urls.py:
from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('sw/<str:t>/s<str:s>/', views.sinfo, name='sinfo'),
]
def sinfo(request, t, s):
Answer the question
In order to leave comments, you need to log in
I found my mistake, it is banal. In views there was another view with the same name. It was read after the view that I was picking and there was no s parameter in it.
Need to rest more often. :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question