テンプレートに値を渡す方法
下記のように辞書形式で渡す。
return TemplateResponse(request, '*****.html',
{"変数名": 変数})
引数をhtml内で使用する方法
下記のように記載すれば変数と同様に扱える。
<h1>{{ 変数名 }}</h1>
モデル等複数要素で構成されていれば、下記のように記載すれば同様に変数として扱える。
<h1>{{ 変数名.要素名 }}</h1>
Go to list of users who liked
More than 3 years have passed since last update.
下記のように辞書形式で渡す。
return TemplateResponse(request, '*****.html',
{"変数名": 変数})
下記のように記載すれば変数と同様に扱える。
<h1>{{ 変数名 }}</h1>
モデル等複数要素で構成されていれば、下記のように記載すれば同様に変数として扱える。
<h1>{{ 変数名.要素名 }}</h1>
Register as a new user and use Qiita more conveniently
Go to list of users who liked