I'm trying to pass a boolean flag to my view:
def lesson_detail_view(request, number, **kwargs):
pass
The documentation has an example of passing in kwargs, but only as hard coded.
path('blog/<int:year>/', views.year_archive, {'foo': 'bar'})
My problem is getting the variable into the url pattern.
I've tried to insert a variable the same way the path variables work with angle brackets, but it's not working.
path('lesson-<number>/', views.lesson_detail_view, kwargs={'show_popup': '<show_popup>'}, name='lesson_detail'),
The following is how I want to call the url:
redirect("lesson:lesson_detail", number=1, show_popup=True,)
Am I barking up the wrong tree? I feel like this should be pretty straight forward, but I'm not finding anything.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…