per page, with , order by , clip by
Results of 1 - 10 of about 42 for style (0.003 sec.)
How to use Django's Content Security Policy 12634
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 ... 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 script ... matching `nonce` attr. "script-src" : [ CSP . SELF , CSP . NONCE ], # Example of the less secure 'unsafe-inline' option. "style-src" : [ CSP . SELF , CSP . UNSAFE_INLINE ], } Add the csp() context processor to your TEMPLATES setting. This makes the g ... go.template.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 styl ...
https://man.mtool.work/django/6.1/howto/csp.html
JavaScript code 11674
JavaScript code While most of Django core is Python, the admin and gis contrib apps contain JavaScript code. Please follow these coding standards when writing JavaScript code for inclusion in Django. Code style Please conform to the indenta ... tion style dictated in the .editorconfig file. We recommend using a text editor with EditorConfig support to avoid indentation and wh ... hen naming variables, use camelCase instead of underscore_case . Different JavaScript files sometimes use a different code style. Please try to conform to the code style of each file. Use the Biome code linter to check your code for bugs and style err ...
https://man.mtool.work/django/6.1/internals/contributing/writing-code/javascript...
Coding style 11550
Coding style Please follow these coding standards when writing code for inclusion in Django. Pre-commit checks pre-commit is a framework for managing pre-commit hooks. These hooks help to identify simple issues before committing code for re ... the tool will go ahead and fix them for you. Review the changes and re-stage for commit if you are happy with them. Python style All files should be formatted using the black auto-formatter. This will be run by pre-commit if that is configured. The pr ... file excludes some errors that we don't consider as gross violations. Remember that PEP 8 is only a guide, so respect the style of the surrounding code as a primary goal. An exception to PEP 8 is our rules on line lengths. We allow up to 88 character ... niqueVoters() ). Use InitialCaps for class names (or for factory functions that return classes). In docstrings, follow the style of existing docstrings and PEP 257 . In tests, use assertRaisesMessage() and assertWarnsMessage() instead of assertRaises( ...
https://man.mtool.work/django/6.1/internals/contributing/writing-code/coding-sty...
はじめての Django アプリ作成、その 6 11550
はじめての Django アプリ作成、その 6 このチュートリアルは チュートリアル 5 の続きです。Web 投票アプリケーションのテストが完成したので、今度はスタイルシートや画像を追加しましょう。 サーバで生成するHTML以外に、Webアプリケーションは一般的に完全 ... れと同じディレクトリ構造が使われます。 先ほど作成した static ディレクトリ内に polls という名前のディレクトリを作り、その中に style.css というファイルを作成します。言い換えれば、スタイルシートは polls/static/polls/style.css にあるはずです。 AppDirectorie ... sFinder のスタティックファイルファインダがどのように動作するかによって、Djangoではこのスタティックファイルを polls/style.css として参照することができます。 静的ファイルの名前空間 テンプレートと同様に、 polls という別のサブディレクトリを作らずに ... ィレクトリの中にテンプレートを置いたのは、そういうわけなのです。 スタイルシートに次のコードを配置します ( polls/static/polls/style.css ): polls/static/polls/style.css li a { color : green ; } 次に、 polls/templates/polls/index.html の上部に追加します: p ...
https://man.mtool.work/django/6.1/intro/tutorial06.html
コンテンツセキュリティポリシー 10219
コンテンツセキュリティポリシー 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 ... 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-eval' . Pe ... abling 'unsafe-eval' for scripts. NONCE Django-specific placeholder value ( "<CSP_NONCE_SENTINEL>" ) used in script-src or style-src directives to activate nonce-based CSP. This string is replaced at runtime by the ContentSecurityPolicyMiddleware with ... ue, random value generated per HTTP response. Django supports nonces as a secure way to allow specific inline <script> or <style> elements to execute without relying on 'unsafe-inline' . Nonces are enabled by including the special placeholder NONCE in ...
https://man.mtool.work/django/6.1/ref/csp.html
Django 4.1 リリースノート 9723
Django 4.1 リリースノート 2022年8月3日 Django 4.1 へようこそ! このリリースノートでは、 バージョン 4.1 の新機能 と、Django 4.0 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。また、 一部の機能を非推奨 とし ... ntrols, such as radio-lists, into fieldsets. The new templates are recommended, and will become the default form rendering style when outputting a form, like {{ form }} in a template, from Django 5.0. In order to ease adopting the new output style, th ... o 5.0 で削除されます。 マイナーな機能 django.contrib.admin The admin dark mode CSS variables are now applied in a separate stylesheet and template block. ModelAdmin リストフィルタ providing custom FieldListFilter subclasses can now control the query s ... rm.template_name_div attribute, and matching Form.as_div() method, render forms using HTML <div> elements. This new output style is recommended over the existing as_table() , as_p() and as_ul() styles, as the template implements <fieldset> and <legend ...
https://man.mtool.work/django/6.1/releases/4.1.html
Django 0.96 リリースノート 8392
Django 0.96 リリースノート Django 0.96 へようこそ! The primary goal for 0.96 is a cleanup and stabilization of the features introduced in 0.95. There have been a few small backwards-incompatible changes since 0.95, but the upgrade process s ... nerated SQL to use the correct constraint names before executing it. Examine the output of manage.py sqlall to see the new-style constraint names, and use that as a guide to rename existing constraints in your database. Name changes in manage.py A few ... and rushing to fix your code after the fact. Just change your import statements like this: from django import forms # 0.95-style from django import oldforms as forms # 0.96-style The next official release of Django will move the current django.newform ...
https://man.mtool.work/django/6.1/releases/0.96.html
Submitting contributions 8268
Submitting contributions We're always grateful for contributions to Django's code. Indeed, bug reports with associated contributions will get fixed far more quickly than those without a solution. Typo fixes and trivial documentation changes ... whether someone has claimed it or not, to link proposals to a ticket if you happen to have the changes ready. Contribution style Make sure that any contribution you do fulfills at least the following requirements: The code required to fix a problem or ... GitHub pull request . If you can't send a pull request for some reason, you can also use patches in Trac. When using this style, follow these guidelines. Submit patches in the format returned by the git diff command. Attach patches to a ticket in the ... ket on Trac? All contributions require a ticket unless the change is considered trivial . All code changes Does the coding style conform to our guidelines? Are there any black , blacken-docs , flake8 , isort , or zizmor errors? You can install the pre ...
https://man.mtool.work/django/6.1/internals/contributing/writing-code/submitting...
カスタム django-admin コマンドの作り方 8036
カスタム django-admin コマンドの作り方 manage.py を用いることで独自のアクションを登録する事ができます。例として、あなたが配布している Django アプリケーションに manage.py アクションを追加したくなったとします。このドキュメントでは、 このチュー ... ommandError ( 'Poll " %s " does not exist' % poll_id ) poll . opened = False poll . save () self . stdout . write ( self . style . SUCCESS ( 'Successfully closed poll " %s "' % poll_id ) ) 注釈 管理コマンドを使用してコンソール出力を提供したい場合は、直 ... 、すべてのシステムチェックを実行するように指定することができます。デフォルトでは '__all__' に設定されています。 BaseCommand. style stdout や stderr を記述した際にカラー出力を補助するインスタンス変数です。以下の利用例を参照ください: self . stdout . write ... ( self . style . SUCCESS ( "..." )) カラーパレットの調整と利用可能なスタイルについては シンタックスカラーリング を参照してください (このセ ...
https://man.mtool.work/django/6.1/howto/custom-management-commands.html
Django 1.2 リリースノート 8036
Django 1.2 リリースノート 2010 年 5 月 17 日 Django 1.2 へようこそ! Nearly a year in the making, Django 1.2 packs an impressive list of new features and lots of bug fixes. These release notes cover the new features, as well as important cha ... ettings has changed. Any existing Django settings file will continue to work as expected until Django 1.4. Until then, old-style database settings will be automatically translated to the new-style format. In the old-style (pre 1.2) format, you had a n ... propriate formats. Function-based test runners Django 1.2 changes the test runner tools to use a class-based approach. Old style function-based test runners will still work, but should be updated to use the new class-based runners . Feed in django.con ... nb . Function-based template loaders Django 1.2 changes the template loading mechanism to use a class-based approach. Old style function-based template loaders will still work, but should be updated to use the new class-based template loaders. ...
https://man.mtool.work/django/6.1/releases/1.2.html
PREV 1 2 3 4 5 NEXT