per page, with , order by , clip by
Results of 1 - 10 of about 46 for script (0.005 sec.)
フォームアセット (Media クラス) 15835
フォームアセット ( Media クラス) 魅力的で使いやすいウェブのフォームを作るには、HTML だけでは不十分です。CSS スタイルシートも必要です。さらに豪華なウィジェットを使いたければ、JavaScript を各ページに配置する必要もあるでしょう。あるページに必要 ... な CSS と JavaScript の組み合わせは、そのページに使用されるウィジェットによって異なります。 ここでアセット定義の出番です。Django では異なるファ ... teFields を描画するのにカレンダーを使いたい場合、独自の Calendar ウィジェットを定義したとき、このウィジェットは CSS や JavaScript と紐付けることができます。フォーム上でこの Calendar ウィジェットを使用するとき、Django は必要な CSS および JavaScript のフ ... ら、ご自分の アプリケーションで自由に使ってください!これらは全て django.contrib.admin.widgets に格納されています。 どの JavaScript ツールキットを使えばいいの? 多くの JavaScript ツールキットが存在し、その多くにはウィジェット (カレンダ ーウィジェットなど) ...
https://man.mtool.work/django/6.1/topics/forms/media.html
How to use Django's Content Security Policy 12082
How to use Django's Content Security Policy Basic config Content Security Policy (CSP) を有効にするには、Django プロジェクトで次のように設定します: Add the CSP middleware to your MIDDLEWARE setting: MIDDLEWARE = [ # ... "django.middleware.c ... 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 ...
https://man.mtool.work/django/6.1/howto/csp.html
コンテンツセキュリティポリシー 10755
コンテンツセキュリティポリシー New in Django 6.0. Content Security Policy (CSP) is a web security standard that helps prevent content injection attacks by restricting the sources from which content can be loaded. It plays an important role ... urces 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 Represen ... ts 'unsafe-eval' . Allows use of eval() and similar JavaScript functions. Strongly discouraged. UNSAFE_HASHES Represents 'unsafe-hashes' . Allows inline event handlers and some javascri ... t 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-ev ...
https://man.mtool.work/django/6.1/ref/csp.html
組み込みテンプレートタグとフィルタ 8390
組み込みテンプレートタグとフィルタ このドキュメントでは、 Django の組み込みテンプレートタグとフィルタについて述べます。 また 自動ドキュメンテーション を使えばインストールされている組み込みタグとカスタムタグのドキュメントを読めるのでお勧めで ... 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 ...
https://man.mtool.work/django/6.1/ref/templates/builtins.html
Django 1.5.2 リリースノート 7978
Django 1.5.2 リリースノート August 13, 2013 This is Django 1.5.2, a bugfix and security release for Django 1.5. Mitigated possible XSS attack via user-supplied redirect URLs Django relies on user input in some cases (e.g. django.contrib.aut ... or these redirects (namely django.utils.http.is_safe_url() ) didn't check if the scheme is http(s) and as such allowed javascript:... URLs to be entered. If a developer relied on is_safe_url() to provide safe redirect targets and put such a URL into a ... sn't affect Django currently, since we only put this URL into the Location response header and browsers seem to ignore JavaScript there. XSS vulnerability in django.contrib.admin If a URLField is used in Django 1.5, it displays the current value of the ... anyToManyField if it has a Unicode name parameter (#20207). Ensured that the WSGI request's path is correctly based on the SCRIPT_NAME environment variable or the FORCE_SCRIPT_NAME setting, regardless of whether or not either has a trailing slash (#201 ...
https://man.mtool.work/django/6.1/releases/1.5.2.html
admin アプリケーションの JavaScript カスタマイズ 7856
admin アプリケーションの JavaScript カスタマイズ インラインフォームイベント インラインフォームが admin アプリケーション変更フォームに追加または削除された際に JavaScript を実行したい場合、 formset:added と formset:removed イベントを使用できま ... {% extends 'admin/change_form.html' %} {% load static %} {% block admin_change_form_document_ready %} {{ block .super }} < script src = " {% static 'app/formset_handlers.js' %} " ></ script > {% endblock %} app/static/app/formset_handlers.js document . ... mset:removed' , ( event ) => { // Row removed }); 注意点が2つあります: もし admin/change_form.html を継承しているなら、JavaScript コードはテンプレートブロック内に配置する必要があります。そうしないと、最終的な HTML にレンダリングされません。 Django の a ... dmin_change_form_document_ready ブロックには、変更フォーム内でのさまざまな操作を処理するための JavaScript コードが含まれており、 {{ block.super }} は、それらもレンダリングする必要があるために追加されています。 バージョン4.1より前 ...
https://man.mtool.work/django/6.1/ref/contrib/admin/javascript.html
Django 3.1.5 リリースノート 7673
Django 3.1.5 リリースノート January 4, 2021 Django 3.1.5 では、3.1.4 におけるいくつかのバグを修正しました。 バグ修正 Fixed __isnull=True lookup on key transforms for JSONField with Oracle and SQLite ( #32252 ). Fixed a bug in Django 3.1 tha ... on in Django 3.1 that caused the incorrect prefixing of STATIC_URL and MEDIA_URL settings, by the server-provided value of SCRIPT_NAME (or / if not set), when set to a URL specifying the protocol but without a top-level domain, e.g. http://myhost/ ( #3 ...
https://man.mtool.work/django/6.1/releases/3.1.5.html
django.urls ユーティリティ関数 7612
django.urls ユーティリティ関数 reverse() reverse() 関数は指定したビューと任意のパラメータに対して、 url タグと同様に、絶対パス参照を返すために使用します。 reverse ( viewname , urlconf = None , args = None , kwargs = None , current_app = Non ... 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 ...
https://man.mtool.work/django/6.1/ref/urlresolvers.html
Django ユーティリティ (django.utils) 7612
Django ユーティリティ ( django.utils ) このドキュメントは、 django.utils のすべての安定したモジュールを対象としています。 django.utils 内のほとんどのモジュールは内部使用を目的としていることから、 内部リリース非推奨ポリシー に従い、以下に記載 ... ote that this method does not encode the ' character, as it is a valid character within URIs. See encodeURIComponent() JavaScript function for more details. エンコードされた結果を含む ASCII 文字列を返します。 escape_uri_path ( path ) [ソース] URI (Unif ... Rss201rev2Feed ( ... title = "Poynter E-Media Tidbits" , ... link = "https://www.poynter.org/tag/e-media-tidbits/" , ... description = "A group blog by the sharpest minds in online media/journalism/publishing." , ... language = "en" , ... ) >>> feed . ... add_item ( ... title = "Hello" , ... link = "https://www.holovaty.com/test/" , ... description = "Testing." , ... ) >>> with open ( "test.rss" , "w" ) as fp : ... feed . write ( fp , "utf-8" ) ... ジェネレータの選択 ...
https://man.mtool.work/django/6.1/ref/utils.html
Django におけるセキュリティ 7612
Django におけるセキュリティ このドキュメントは、Django のセキュリティ機能の概要です。Django を利用したサイトを安全なものにするためのヒントを説明します。 Real-world security Django's web security implementations have been designed with secur ... る必要があります。Django におけるユーザー入力の検証については、 フォームに関するドキュメント を参照してください。 Cross-site scripting (XSS) protection In a cross-site scripting attack, malicious code in the form of a client-side script is injected into ... another user's web browser, where it will be executed. This is typically done by: storing the malicious script in the database where it will be retrieved and presented to other users in their browsers, or getting users to click a lin ... k which will cause the attacker's JavaScript to be executed by the user's browser. Cross-site scripting attacks can originate from any untrusted source of data, includ ...
https://man.mtool.work/django/6.1/topics/security.html
PREV 1 2 3 4 5 NEXT