search
LoginSignup
0

More than 1 year has passed since last update.

posted at

updated at

Django: url kwargsをtemplate内で取得する

kwargsの取得

slugなどのkwargsをtemplate内で取得する方法です。

環境

  • Django: 2.2.9
  • Python: 3.8.2

template

templates/sample.html
<div>
  {{ view.kwargs.pk_name }}
  {{ view.kwargs.slug_name }}
</div>

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
0