... ngo provides predefined constants representing common CSP source expression keywords such as 'self' , 'none' , and 'unsafe-inline' . These constants are intended for use in the directive values defined in the settings. They are available through the CS ... ' . Allows execution of scripts loaded by a trusted script (e.g., one with a valid nonce or hash), without needing 'unsafe-inline' . UNSAFE_EVAL Represents 'unsafe-eval' . Allows use of eval() and similar JavaScript functions. Strongly discouraged. UNS ... AFE_HASHES Represents 'unsafe-hashes' . Allows inline event handlers and some javascript: URIs when their content hashes match a policy rule. Requires CSP Level 3+. UNSAFE_INLI ... ... script tags with 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. ... .. "django.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 inli ... ne styles will be allowed. */ </ style > < script nonce = " {{ csp_nonce }} " > // This inline JavaScript will be allowed. </ script > For external <script src="..."> and <link rel="stylesheet"> elements, use the csp_ ... ... a parent model with related model inlines, where the user has view-only permissions to a parent model but edit permissions to the inline model, would display a rea ... d-only view of the parent model but editable forms for the inline. Submitting these forms would not allow direct edits to the parent model, but would trigger the parent model's save() meth ... a parent model, the entire displayed form will not be editable, even if the user has permission to edit models included in inlines. This is a backwards-incompatible change, and the Django security team is aware that some users of Django were depending ... ... isplaying a parent model with related model inlines, where the user has view-only permissions to a parent model but edit permissions to the inline model, would display a rea ... d-only view of the parent model but editable forms for the inline. Submitting these forms would not allow direct edits to the parent model, but would trigger the parent model's save() meth ... a parent model, the entire displayed form will not be editable, even if the user has permission to edit models included in inlines. This is a backwards-incompatible change, and the Django security team is aware that some users of Django were depending ... ... ... ... re Remove the core argument from your model fields. It is no longer necessary, since the equivalent functionality (part of inline editing ) is handled differently by the admin interface now. You don't have to worry about inline editing until you get to ... all in an admin.py file. Below are some more details on how to rewrite that Admin declaration into the new syntax. Use new inline syntax The new edit_inline options have all been moved to admin.py . Here's an example: Old (0.96): class Parent ( models ... . Model ): ... class Child ( models . Model ): parent = models . ForeignKey ( Parent , edit_inline = models . STACKED , num_in_admin = 3 ) New (1.0): class ChildInline ( admin . StackedInline ): model = Child extra = 3 cl ... ... renced in the admin ( #23604 ). Allowed inline and hidden references to admin fields ( #23431 ). Fixed parsing of the GEOS version string ( #20036 ). ... ... す。あるいは、プレーンテキストと django.utils.html.escape() を使って HTML の特殊文字をエスケープすることもできます。 TabularInline は fieldsets の機能の一部しか利用できません TabularInline で fieldsets を使用する際は、機能が制限されています。 TabularInl ... id_fields 、 radio_fields 、 autocomplete_fields の 3 つがこれら自身のカスタムウィジェットを暗示するからです。 ModelAdmin. inlines 後述の InlineModelAdmin オブジェクトと ModelAdmin.get_formsets_with_inlines() を参照してください。 ModelAdmin. list_displ ... nd the delete_selected action if specified for ModelAdmin , and to protected deletion validation messages if specified for InlineModelAdmin . By default, this is None (no truncation). ModelAdmin. object_history_template カスタムンテンプレートの絶対パス ... ... o.contrib.admin.ModelAdmin.readonly_fields has been added to enable non-editable fields in add/change pages for models and inlines. Field and calculated values can be displayed alongside editable fields. Customizable syntax highlighting You can now use ... tation is now included with Django's and is no longer hosted separately at geodjango.org . JavaScript-assisted handling of inline related objects in the admin If a user has JavaScript enabled in their browser, the interface for inline objects in the ad ... min now allows inline objects to be dynamically added and removed. Users without JavaScript-enabled browsers will see no change in the behavior ... 2026年10月08日