... tacks by restricting the sources from which content can be loaded. It plays an important role in a comprehensive security strategy . For configuration instructions in a Djang ... o project, see the Using CSP documentation. For an HTTP guide about CSP, see the MDN Guide on CSP . 概要 ¶ The Content-Security-Policy specification defines two complementary headers: Content-Security-Policy : Enforces the CSP policy, blocki ... ng content that violates the defined directives. Content-Security-Policy-Report-Only : Reports CSP violations without blocking conten ... ... tacks by restricting the sources from which content can be loaded. It plays an important role in a comprehensive security strategy . For configuration instructions in a Djang ... o project, see the Using CSP documentation. For an HTTP guide about CSP, see the MDN Guide on CSP . 概要 ¶ The Content-Security-Policy specification defines two complementary headers: Content-Security-Policy : Enforces the CSP policy, blocki ... ng content that violates the defined directives. Content-Security-Policy-Report-Only : Reports CSP violations without blocking conten ... ... するときに使用するコンテキストデータ。 これは dict でなければなりません。 例: {'foo': 123} SimpleTemplateResponse. rendered_content [ソース] ¶ 現在のテンプレートとコンテキストデータを使ってレンダリングされた、レスポンスコンテンツの現在の値。 SimpleTempla ... スの内容がレンダリングされたかどうかを示す真偽値。 メソッド ¶ SimpleTemplateResponse. __init__ ( template , context = None , content_type = None , status = None , charset = None , using = None , headers = None ) [ソース] ¶ SimpleTemplateResponse オブジェク ... template, or a list of template names. context テンプレートコンテキストに追加する値の dict 。デフォルトでは空の辞書です。 content_type HTTP の Content-Type ヘッダに含まれる値で、MIME タイプ指定と文字セットエンコーディングを含みます。もし content_type が ... ... するときに使用するコンテキストデータ。 これは dict でなければなりません。 例: {'foo': 123} SimpleTemplateResponse. rendered_content [ソース] ¶ 現在のテンプレートとコンテキストデータを使ってレンダリングされた、レスポンスコンテンツの現在の値。 SimpleTempla ... スの内容がレンダリングされたかどうかを示す真偽値。 メソッド ¶ SimpleTemplateResponse. __init__ ( template , context = None , content_type = None , status = None , charset = None , using = None , headers = None ) [ソース] ¶ SimpleTemplateResponse オブジェク ... template, or a list of template names. context テンプレートコンテキストに追加する値の dict 。デフォルトでは空の辞書です。 content_type HTTP の Content-Type ヘッダに含まれる値で、MIME タイプ指定と文字セットエンコーディングを含みます。もし content_type が ... ... core.mail import EmailMultiAlternatives from django.template.loader import render_to_string # First, render the plain text content. text_content = render_to_string ( "templates/emails/my_email.txt" , context = { "my_variable" : 42 }, ) # Secondly, rende ... r the HTML content. html_content = render_to_string ( "templates/emails/my_email.html" , context = { "my_variable" : 42 }, ) # Then, create a ... multipart email instance. msg = EmailMultiAlternatives ( subject = "Subject here" , body = text_content , from_email = "from@example.com" , to = [ "to@example.com" ], headers = { "List-Unsubscribe" : "<mailto:unsub@example.com ... ... core.mail import EmailMultiAlternatives from django.template.loader import render_to_string # First, render the plain text content. text_content = render_to_string ( "templates/emails/my_email.txt" , context = { "my_variable" : 42 }, ) # Secondly, rende ... r the HTML content. html_content = render_to_string ( "templates/emails/my_email.html" , context = { "my_variable" : 42 }, ) # Then, create a ... multipart email instance. msg = EmailMultiAlternatives ( subject = "Subject here" , body = text_content , from_email = "from@example.com" , to = [ "to@example.com" ], headers = { "List-Unsubscribe" : "<mailto:unsub@example.com ... ... ing 値を使用します。フォームデータが DEFAULT_CHARSET エンコーディングでないことがわかっている場合に便利です。 HttpRequest. content_type ¶ リクエストの MIME タイプを表す文字列です。 CONTENT_TYPE から識別されます。 HttpRequest. content_params ¶ CONTENT_TY ... ヘッダーが格納されたディクショナリです。利用可能なヘッダーはクライアントとサーバーによって異なりますが、以下に例を示します。 CONTENT_LENGTH -- リクエスト本文の (文字列としての) 長さです。 CONTENT_TYPE -- リクエスト本文の MIME タイプです。 HTTP_ACCEPT -- レ ... や "POST" といったです。 SERVER_NAME -- サーバのホスト名です。 SERVER_PORT -- (文字列としての) サーバのポートです。 上記の CONTENT_LENGTH と CONTENT_TYPE を除き、リクエストの HTTP ヘッダーは、すべての文字を大文字に変換し、ハイフンをアンダースコアに置き換 ... ... ing 値を使用します。フォームデータが DEFAULT_CHARSET エンコーディングでないことがわかっている場合に便利です。 HttpRequest. content_type ¶ リクエストの MIME タイプを表す文字列です。 CONTENT_TYPE から識別されます。 HttpRequest. content_params ¶ CONTENT_TY ... ヘッダーが格納されたディクショナリです。利用可能なヘッダーはクライアントとサーバーによって異なりますが、以下に例を示します。 CONTENT_LENGTH -- リクエスト本文の (文字列としての) 長さです。 CONTENT_TYPE -- リクエスト本文の MIME タイプです。 HTTP_ACCEPT -- レ ... や "POST" といったです。 SERVER_NAME -- サーバのホスト名です。 SERVER_PORT -- (文字列としての) サーバのポートです。 上記の CONTENT_LENGTH と CONTENT_TYPE を除き、リクエストの HTTP ヘッダーは、すべての文字を大文字に変換し、ハイフンをアンダースコアに置き換 ... ... デルを追跡し、モデルを扱うための高レベルで汎用的なインターフェースを提供します。 概要 ¶ contenttypes アプリケーションの中心にあるのは、 django.contrib.contenttypes.models.ContentType にある ContentType モデルです。 Con ... tentType のインスタンスは、プロジェクトにインストールされたモデルに関する情報を表し、格納します。新しい ContentType のインスタンスは、新しいモデルがインストールされるたびに自動的に作成されます。 ContentType のインスタンスは ContentTyp ... e が表すモデルクラスを返すメソッドと、それらのモデルからオブジェクトを問い合わせるメソッドを持っています。また、 ContentType を操作するためのメソッドや、特定のモデルの ContentType のインスタンスを取得するためのメソッドを追加する カスタムマネー ... ... デルを追跡し、モデルを扱うための高レベルで汎用的なインターフェースを提供します。 概要 ¶ contenttypes アプリケーションの中心にあるのは、 django.contrib.contenttypes.models.ContentType にある ContentType モデルです。 Con ... tentType のインスタンスは、プロジェクトにインストールされたモデルに関する情報を表し、格納します。新しい ContentType のインスタンスは、新しいモデルがインストールされるたびに自動的に作成されます。 ContentType のインスタンスは ContentTyp ... e が表すモデルクラスを返すメソッドと、それらのモデルからオブジェクトを問い合わせるメソッドを持っています。また、 ContentType を操作するためのメソッドや、特定のモデルの ContentType のインスタンスを取得するためのメソッドを追加する カスタムマネー ... 2026年10月08日