... ウィジェットを使いたければ、JavaScript を各ページに配置する必要もあるでしょう。あるページに必要な CSS と JavaScript の組み合わせは、そのページに使用されるウィジェ ... teFields を描画するのにカレンダーを使いたい場合、独自の Calendar ウィジェットを定義したとき、このウィジェットは CSS や JavaScript と紐付けることができます。フォーム上でこの Calendar ウィジェットを使用するとき、Django は必要な CSS および JavaScript のフ ... ら、ご自分の アプリケーションで自由に使ってください!これらは全て django.contrib.admin.widgets に格納されています。 どの JavaScript ツールキットを使えばいいの? 多くの JavaScript ツールキットが存在し、その多くにはウィジェット (カレンダ ーウィジェットなど) ... ... ウィジェットを使いたければ、JavaScript を各ページに配置する必要もあるでしょう。あるページに必要な CSS と JavaScript の組み合わせは、そのページに使用されるウィジェ ... teFields を描画するのにカレンダーを使いたい場合、独自の Calendar ウィジェットを定義したとき、このウィジェットは CSS や JavaScript と紐付けることができます。フォーム上でこの Calendar ウィジェットを使用するとき、Django は必要な CSS および JavaScript のフ ... ら、ご自分の アプリケーションで自由に使ってください!これらは全て django.contrib.admin.widgets に格納されています。 どの JavaScript ツールキットを使えばいいの? 多くの JavaScript ツールキットが存在し、その多くにはウィジェット (カレンダ ーウィジェットなど) ... ... olicy, beside the basic config, you need to: Include the NONCE placeholder value in the CSP settings. This only applies to script-src or style-src directives: from django.utils.csp import CSP SECURE_CSP = { "default-src" : [ CSP . SELF ], # Allow self- ... hosted scripts and script tags with matching `nonce` attr. "script-src" : [ CSP . SELF , CSP . NONCE ], # Example of the less secure 'un ... .context_processors.csp" , ], }, }, ] In your templates, add the nonce to elements that require it: For inline <style> or <script> tags, use the csp_nonce context variable directly: < style nonce = " {{ csp_nonce }} " > /* These inline styles will be a ... ... olicy, beside the basic config, you need to: Include the NONCE placeholder value in the CSP settings. This only applies to script-src or style-src directives: from django.utils.csp import CSP SECURE_CSP = { "default-src" : [ CSP . SELF ], # Allow self- ... hosted scripts and script tags with matching `nonce` attr. "script-src" : [ CSP . SELF , CSP . NONCE ], # Example of the less secure 'un ... .context_processors.csp" , ], }, }, ] In your templates, add the nonce to elements that require it: For inline <style> or <script> tags, use the csp_nonce context variable directly: < style nonce = " {{ csp_nonce }} " > /* These inline styles will be a ... ... ces from the same origin (same scheme, host, and port). STRICT_DYNAMIC ¶ Represents 'strict-dynamic' . Allows execution of scripts loaded by a trusted script (e.g., one with a valid nonce or hash), without needing 'unsafe-inline' . UNSAFE_EVAL ¶ Repres ... ents 'unsafe-eval' . Allows use of eval() and similar JavaScript functions. Strongly discouraged. UNSAFE_HASHES ¶ Represents 'unsafe-hashes' . Allows inline event handlers and some javasc ... hashes match a policy rule. Requires CSP Level 3+. UNSAFE_INLINE ¶ Represents 'unsafe-inline' . Allows execution of inline scripts, styles, and javascript: URLs. Generally discouraged, especially for scripts. WASM_UNSAFE_EVAL ¶ Represents 'wasm-unsafe- ... ... ces from the same origin (same scheme, host, and port). STRICT_DYNAMIC ¶ Represents 'strict-dynamic' . Allows execution of scripts loaded by a trusted script (e.g., one with a valid nonce or hash), without needing 'unsafe-inline' . UNSAFE_EVAL ¶ Repres ... ents 'unsafe-eval' . Allows use of eval() and similar JavaScript functions. Strongly discouraged. UNSAFE_HASHES ¶ Represents 'unsafe-hashes' . Allows inline event handlers and some javasc ... hashes match a policy rule. Requires CSP Level 3+. UNSAFE_INLINE ¶ Represents 'unsafe-inline' . Allows execution of inline scripts, styles, and javascript: URLs. Generally discouraged, especially for scripts. WASM_UNSAFE_EVAL ¶ Represents 'wasm-unsafe- ... ... a nonce="<value>" HTML attribute when the csp() context processor is configured, and an empty string otherwise. Use it in <script> or <link> elements to allow them under a nonce-based Content Security Policy: < script src = "/path/to/script.js" {% csp_ ... nonce_attr %} ></ script > < link rel = "stylesheet" href = "/path/to/style.css" {% csp_nonce_attr %} > When called with a Media object as the argu ... ment, renders its assets with the CSP nonce applied to each <script> and <link> element: {% csp_nonce_attr form.media %} In both forms, if the context processor is not configured, assets are ... ... a nonce="<value>" HTML attribute when the csp() context processor is configured, and an empty string otherwise. Use it in <script> or <link> elements to allow them under a nonce-based Content Security Policy: < script src = "/path/to/script.js" {% csp_ ... nonce_attr %} ></ script > < link rel = "stylesheet" href = "/path/to/style.css" {% csp_nonce_attr %} > When called with a Media object as the argu ... ment, renders its assets with the CSP nonce applied to each <script> and <link> element: {% csp_nonce_attr form.media %} In both forms, if the context processor is not configured, assets are ... ... st" ] = request try : view ( * args , ** kwargs ) except Http404 : return HttpResponseRedirect ( "/" ) return response get_script_prefix() ¶ get_script_prefix () [ソース] ¶ 通常、アプリケーション内でURLを定義する際には、常に reverse() を使用すべきです。 ... ジェクトのベースURLをそのWebサーバー内で見つける必要があります(通常、 reverse() がこれを処理します)。そのような場合、 get_script_prefix() を呼び出すことができます。これは、DjangoプロジェクトのURLのスクリプトプレフィックス部分を返します。あなたのDjango ... るため、そのサイクルの外部では 使用できません 。 目次 django.urls ユーティリティ関数 reverse() reverse_lazy() resolve() get_script_prefix() 前のトピックへ Unicode データ 次のトピックへ URLconf で使用するための django.urls 関数 関連キーワード reverse 場合 ... ... st" ] = request try : view ( * args , ** kwargs ) except Http404 : return HttpResponseRedirect ( "/" ) return response get_script_prefix() ¶ get_script_prefix () [ソース] ¶ 通常、アプリケーション内でURLを定義する際には、常に reverse() を使用すべきです。 ... ジェクトのベースURLをそのWebサーバー内で見つける必要があります(通常、 reverse() がこれを処理します)。そのような場合、 get_script_prefix() を呼び出すことができます。これは、DjangoプロジェクトのURLのスクリプトプレフィックス部分を返します。あなたのDjango ... るため、そのサイクルの外部では 使用できません 。 目次 django.urls ユーティリティ関数 reverse() reverse_lazy() resolve() get_script_prefix() 前のトピックへ Unicode データ 次のトピックへ URLconf で使用するための django.urls 関数 関連キーワード reverse ビュ ... 2026年10月08日