... def my_task (): pass Changed in Django 6.1: Support for passing arbitrary **kwargs to the @task decorator is added. If the defined Task is not valid according to the backend, InvalidTask is raised. See defining tasks for usage examples. Task class Task ... [ソース] Represents a Task to be run in the background. Tasks should be defined using the task() decorator. Attributes of Task cannot be modified. See modifying Tasks for details. priority The priority ... et to True to use this feature. backend The alias of the backend the Task should be enqueued to. This must match a backend defined in BACKEND . queue_name The name of the queue the Task will be enqueued on to. Defaults to "default" . This must match a q ... ... those will of course cause deprecation warnings.) There are two deprecated features that are not supported when MAILERS is defined in a project's settings: Trying to access any of the deprecated EMAIL_* settings on django.conf.settings (e.g., checking s ... path. (Other arguments to get_connection() are still supported, and will simply issue deprecation warnings when MAILERS is defined.) If a third-party package does either of those, projects that use it will not be able to change to the MAILERS setting un ... til the package has been updated. Solving "not available when MAILERS is defined" errors If either of these errors are raised within a third-party package, that indicates it is not compatible with the MA ... ... ent aid (for projects created with startproject ) or results in a MailerDoesNotExist error (when the MAILERS setting isn't defined). Use the MAILERS setting to tell Django how to send email. For example, to send through an SMTP server running on the loc ... w-deprecated EMAIL_BACKEND and related settings. バージョン 6.1 で非推奨: Until Django 2028, if the MAILERS setting is not defined then the earlier behavior still applies: Django will default to using an SMTP server on localhost (but will issue deprecat ... ion warnings). Starting in Django 2028, attempts to send email without MAILERS defined will result in a MailerDoesNotExist error. Existing projects can opt into the new behavior early by adding MAILERS to sett ... ... lse, with the ready() method of their configuration. Application labels are assigned correctly to models even when they're defined outside of models.py . You don't have to set app_label explicitly any more. It is possible to omit models.py entirely if a ... s context managers Prior to Python 2.7, database cursors could be used as a context manager. The specific backend's cursor defined the behavior of the context manager. The behavior of magic method lookups was changed with Python 2.7 and cursors were no ... g passed into Field constructors - things like custom Storage subclasses, for instance - need to have a deconstruct method defined on them as well , though Django provides a handy class decorator that will work for most applications. App-loading changes ... ... n defines two complementary headers: Content-Security-Policy : Enforces the CSP policy, blocking content that violates the defined directives. Content-Security-Policy-Report-Only : Reports CSP violations without blocking content, allowing for non-intrus ... must implement your own reporting endpoint or integrate with a third-party monitoring service. CSP 定数 Django provides predefined constants representing common CSP source expression keywords such as 'self' , 'none' , and 'unsafe-inline' . These constan ... ts are intended for use in the directive values defined in the settings. They are available through the CSP enum, and using them is recommended over raw strings. This helps avoid ... ... has been specified. Test databases get their names by prepending test_ to the value of the NAME settings for the databases defined in DATABASES . These test databases are deleted when the tests are finished. You will also need to ensure that your databa ... ts Isolating model registration To avoid polluting the global apps registry and prevent unnecessary table creation, models defined in a test method should be bound to a temporary Apps instance. To do this, use the isolate_apps() decorator: from django.d ... ( "app_label" ) def test_model_definition ( self ): class TestModel ( models . Model ): pass ... Setting app_label Models defined in a test method with no explicit app_label are automatically assigned the label of the app in which their test class is l ... ... on that can be used for deploying with WSGI app servers . The built-in development server now supports using an externally-defined WSGI callable, which makes it possible to run runserver with the same WSGI configuration that is used for deployment. The ... s and stylesheets. Django 1.3 added a new contrib app django.contrib.staticfiles to handle such files in a generic way and defined conventions for static files included in apps. Starting in Django 1.4, the admin's static files also follow this conventio ... ntrib.sessions data integrity check Consequences: The user will be logged out, and session data will be lost. Time period: Defined by SESSION_COOKIE_AGE . contrib.auth password reset hash Consequences: Password reset links from before the upgrade will n ... ... ashes to prevent a timing attack for that case. バグ修正 Skipped URL checks (new in 1.9) if the ROOT_URLCONF setting isn't defined ( #26155 ). TIME_ZONE=None と USE_TZ=False の使用を妨げる PostgreSQL のクラッシュ修正しました ( #26177 )。 隠された関係のク ... om sharing their cache ( #26286 ). Reverted a change in Django 1.9.2 ( #25858 ) that prevented relative lazy relationships defined on abstract models to be resolved according to their concrete model's app_label ( #26186 ). ... ... include: Django now uses a more consistent and natural filtering interface for retrieving objects from the database. User-defined models, functions and constants now appear in the module namespace they were defined in. (Previously everything was magica ... ... it evolves. See 非同期クエリ for details and limitations. 制約のバリデーション Check , unique , and exclusion constraints defined in the Meta.constraints option are now checked during model validation . Form rendering accessibility In order to aid user ... mmand allows optimizing operations for a migration. マイグレーション The new RenameIndex operation allows renaming indexes defined in the Meta.indexes or index_together options. The migrations autodetector now generates RenameIndex operations instead of ... RemoveIndex and AddIndex , when renaming indexes defined in the Meta.indexes . The migrations autodetector now generates RenameIndex operations instead of AlterIndexTogether and A ... 2026年10月08日