I'm going to explain how the url works with views.py
I put the angle bracket<> in the path as '<shortcode>'.
If I put http://localhost:8000/view1/sss to URL, 'sss' value is going to be a parameter from kirr_redirect_view function as a second parameter (shortcode).
If I put <sss> like below,
path('view1/<sss>',kirr_redirect_view),
def kirr_redirect_view(request,sss=None, *args, **kwargs):
print(args)
print(kwargs)
print(sss)
return HttpResponse("hello")
then the second parameter has to be same.
The below is the flow from Request to View.
Django with Docker (0) | 2021.01.15 |
---|---|
Set Global Variable using settings.py (0) | 2020.10.29 |
Django URL with View (0) | 2020.10.29 |
Django Architecture (0) | 2020.10.29 |
댓글 영역