... に、Django はフィルタ名として関数の名前を利用します。 最後に、 register.filter() は 3 つのキーワード引数 ( is_safe 、 needs_autoescape 、 expects_localtime ) を受け入れます。これらの引数は、後述の フィルタと自動エスケープ と フィルタとタイムゾーン の中で説明 ... きるフィルタを書くことが考えられます。 フィルタが現在の自動エスケープの状態を知るためには、フィルタ関数を登録する際に needs_autoescape フラグを True に設定します。(このフラグを指定しない場合、デフォルトは False です)。このフラグは、追加のキーワード引数 auto ... jangoに渡すようにフィルタ関数に伝えます。この引数は自動エスケープが有効の場合は True 、そうでない場合は False となります。 autoescape パラメータのデフォルトは True に設定しておくことが推奨されます。これにより、Pythonコードから関数を呼び出したときにデフォル ... ... に、Django はフィルタ名として関数の名前を利用します。 最後に、 register.filter() は 3 つのキーワード引数 ( is_safe 、 needs_autoescape 、 expects_localtime ) を受け入れます。これらの引数は、後述の フィルタと自動エスケープ と フィルタとタイムゾーン の中で説明 ... きるフィルタを書くことが考えられます。 フィルタが現在の自動エスケープの状態を知るためには、フィルタ関数を登録する際に needs_autoescape フラグを True に設定します。(このフラグを指定しない場合、デフォルトは False です)。このフラグは、追加のキーワード引数 auto ... jangoに渡すようにフィルタ関数に伝えます。この引数は自動エスケープが有効の場合は True 、そうでない場合は False となります。 autoescape パラメータのデフォルトは True に設定しておくことが推奨されます。これにより、Pythonコードから関数を呼び出したときにデフォル ... ... を使えばインストールされている組み込みタグとカスタムタグのドキュメントを読めるのでお勧めです。 組み込みタグリファレンス ¶ autoescape ¶ 自動エスケープ機能を制御します。このタグは引数に on または off を取り、ブロック内の自動エスケープの有効・無効を決定します ... 。ブロックの最後は endautoescape タグで閉じるようにします。 使用例: {% autoescape on %} {{ body }} {% endautoescape %} 自動エスケープがオンの場合、すべての ... e を含むフィルタを連結すると、以下のような予期しない(しかしドキュメント化されている)結果を引き起こす可能性があります: {% autoescape off %} {{ my_list | join :", " | escape }} {% endautoescape %} 上記のコードは my_list の結合された要素をエスケープせずに出 ... ... を使えばインストールされている組み込みタグとカスタムタグのドキュメントを読めるのでお勧めです。 組み込みタグリファレンス ¶ autoescape ¶ 自動エスケープ機能を制御します。このタグは引数に on または off を取り、ブロック内の自動エスケープの有効・無効を決定します ... 。ブロックの最後は endautoescape タグで閉じるようにします。 使用例: {% autoescape on %} {{ body }} {% endautoescape %} 自動エスケープがオンの場合、すべての ... e を含むフィルタを連結すると、以下のような予期しない(しかしドキュメント化されている)結果を引き起こす可能性があります: {% autoescape off %} {{ my_list | join :", " | escape }} {% endautoescape %} 上記のコードは my_list の結合された要素をエスケープせずに出 ... ... ック単位での制御 ¶ テンプレート単位で自動エスケープを制御するには、テンプレート (または テンプレートの一部) を、以下のように autoescape タグで囲みます: {% autoescape off %} Hello {{ name }} {% endautoescape %} autoescape タグは、 on または off を引数にとりま ... らにその一部で自動エスケープをオフにしたい場合には、次のようにできます: Auto-escaping is on by default. Hello {{ name }} {% autoescape off %} This will not be auto-escaped: {{ data }} . Nor this: {{ other_data }} {% autoescape on %} Auto-escaping applies ag ... ain: {{ name }} {% endautoescape %} {% endautoescape %} 自動エスケープのタグは、他のブロックタグと同様、タグを設定したテンプレートを継承している他のテンプレ ... ... ック単位での制御 ¶ テンプレート単位で自動エスケープを制御するには、テンプレート (または テンプレートの一部) を、以下のように autoescape タグで囲みます: {% autoescape off %} Hello {{ name }} {% endautoescape %} autoescape タグは、 on または off を引数にとりま ... らにその一部で自動エスケープをオフにしたい場合には、次のようにできます: Auto-escaping is on by default. Hello {{ name }} {% autoescape off %} This will not be auto-escaped: {{ data }} . Nor this: {{ other_data }} {% autoescape on %} Auto-escaping applies ag ... ain: {{ name }} {% endautoescape %} {% endautoescape %} 自動エスケープのタグは、他のブロックタグと同様、タグを設定したテンプレートを継承している他のテンプレ ... ... , debug = False , loaders = None , string_if_invalid = '' , file_charset = 'utf-8' , libraries = None , builtins = None , autoescape = True ) [ソース] ¶ Engine をインスタンス化する際は、すべての引数をキーワード引数として渡す必要があります: dirs はエンジン ... トは空のリストです。 app_dirs は loaders のデフォルト値にだけ影響します。下記を参照してください。 デフォルトは False です。 autoescape はHTMLのオートエスケープを有効にするかどうかをコントロールします。 デフォルトは True です。 警告 HTML以外のテンプレートをレ ... グできます。同じテンプレートを再利用して、異なるコンテキストで何度でもレンダリングできます。 class Context ( dict_ = None , autoescape = True , use_l10n = None , use_tz = None ) [ソース] ¶ django.template.Context のコンストラクタは、オプションの引数(変数名 ... ... , debug = False , loaders = None , string_if_invalid = '' , file_charset = 'utf-8' , libraries = None , builtins = None , autoescape = True ) [ソース] ¶ Engine をインスタンス化する際は、すべての引数をキーワード引数として渡す必要があります: dirs はエンジン ... トは空のリストです。 app_dirs は loaders のデフォルト値にだけ影響します。下記を参照してください。 デフォルトは False です。 autoescape はHTMLのオートエスケープを有効にするかどうかをコントロールします。 デフォルトは True です。 警告 HTML以外のテンプレートをレ ... グできます。同じテンプレートを再利用して、異なるコンテキストで何度でもレンダリングできます。 class Context ( dict_ = None , autoescape = True , use_l10n = None , use_tz = None ) [ソース] ¶ django.template.Context のコンストラクタは、オプションの引数(変数名 ... ... nted as part of the public API, but a deprecation path is needed due to use in existing manage.py files. is_safe and needs_autoescape attributes of template filters ¶ Two flags, is_safe and needs_autoescape , define how each template filter interacts with ... ts django.contrib.databrowse django.core.management.setup_environ django.core.management.execute_manager is_safe and needs_autoescape attributes of template filters Wildcard expansion of application names in INSTALLED_APPS HttpRequest.raw_post_data renamed ... ... nted as part of the public API, but a deprecation path is needed due to use in existing manage.py files. is_safe and needs_autoescape attributes of template filters ¶ Two flags, is_safe and needs_autoescape , define how each template filter interacts with ... ts django.contrib.databrowse django.core.management.setup_environ django.core.management.execute_manager is_safe and needs_autoescape attributes of template filters Wildcard expansion of application names in INSTALLED_APPS HttpRequest.raw_post_data renamed ... 2026年10月08日