... . This must match a queue defined in QUEUES , unless QUEUES is set to [] . run_after ¶ The earliest time the Task will be executed. This can be a timedelta , which is used relative to the current time, a timezone-aware datetime , or None if not constrai ... us [ソース] ¶ An Enum representing the status of a TaskResult . READY ¶ The Task has just been enqueued, or is ready to be executed again. RUNNING ¶ The Task is currently being executed. FAILED ¶ The Task raised an exception during execution, or was unab ... een run. If the task is currently running, it does not count as an attempt. worker_ids ¶ The ids of the workers which have executed the Task. Task errors ¶ class TaskError ¶ Contains information about the error raised during the execution of a Task . tra ... ... . This must match a queue defined in QUEUES , unless QUEUES is set to [] . run_after ¶ The earliest time the Task will be executed. This can be a timedelta , which is used relative to the current time, a timezone-aware datetime , or None if not constrai ... us [ソース] ¶ An Enum representing the status of a TaskResult . READY ¶ The Task has just been enqueued, or is ready to be executed again. RUNNING ¶ The Task is currently being executed. FAILED ¶ The Task raised an exception during execution, or was unab ... een run. If the task is currently running, it does not count as an attempt. worker_ids ¶ The ids of the workers which have executed the Task. Task errors ¶ class TaskError ¶ Contains information about the error raised during the execution of a Task . tra ... ... # Explicitly connect a signal handler. request_finished . connect ( signals . my_receiver ) 注釈 The ready() method may be executed more than once during testing, so you may want to guard your signals from duplication if your receiver is a bound method o ... ey are async before being called. This means that an asynchronous receiver registered before a synchronous receiver may be executed after the synchronous receiver. In addition, async receivers are executed concurrently using asyncio.TaskGroup . 非同期のリ ... み込みシグナルは Signal.send() を使ってディスパッチされます。 Changed in Django 6.1: In older versions, async receivers were executed via asyncio.gather() . シグナルを切断する ¶ Signal. disconnect ( receiver = None , sender = None , dispatch_uid = None ) [ ... ... simple_middleware ( get_response ): # One-time configuration and initialization. def middleware ( request ): # Code to be executed for each request before # the view (and later middleware) are called. response = get_response ( request ) # Code to be exe ... f . get_response = get_response # One-time configuration and initialization. def __call__ ( self , request ): # Code to be executed for each request before # the view (and later middleware) are called. response = self . get_response ( request ) # Code to ... be executed for each request/response after # the view is called. return response Django によって渡される get_response 呼び出し可能オブ ... ... # Explicitly connect a signal handler. request_finished . connect ( signals . my_receiver ) 注釈 The ready() method may be executed more than once during testing, so you may want to guard your signals from duplication if your receiver is a bound method o ... ey are async before being called. This means that an asynchronous receiver registered before a synchronous receiver may be executed after the synchronous receiver. In addition, async receivers are executed concurrently using asyncio.TaskGroup . 非同期のリ ... み込みシグナルは Signal.send() を使ってディスパッチされます。 Changed in Django 6.1: In older versions, async receivers were executed via asyncio.gather() . シグナルを切断する ¶ Signal. disconnect ( receiver = None , sender = None , dispatch_uid = None ) [ ... ... le. Configuring a Task backend ¶ The Task backend determines how and where Tasks are stored for execution and how they are executed. Different Task backends have different characteristics and configuration options, which may impact the performance and re ... forced. Task context ¶ Sometimes, the running Task may need to know context about how it was enqueued, and how it is being executed. This can be accessed by taking a context argument, which is an instance of TaskContext . To receive the Task context as a ... > email_users . using ( priority = 10 ) . priority 10 Enqueueing Tasks ¶ To add the Task to the queue store, so it will be executed, call the enqueue() method on it. If the Task takes arguments, these can be passed as-is. For example: result = email_user ... ... le. Configuring a Task backend ¶ The Task backend determines how and where Tasks are stored for execution and how they are executed. Different Task backends have different characteristics and configuration options, which may impact the performance and re ... forced. Task context ¶ Sometimes, the running Task may need to know context about how it was enqueued, and how it is being executed. This can be accessed by taking a context argument, which is an instance of TaskContext . To receive the Task context as a ... > email_users . using ( priority = 10 ) . priority 10 Enqueueing Tasks ¶ To add the Task to the queue store, so it will be executed, call the enqueue() method on it. If the Task takes arguments, these can be passed as-is. For example: result = email_user ... ... simple_middleware ( get_response ): # One-time configuration and initialization. def middleware ( request ): # Code to be executed for each request before # the view (and later middleware) are called. response = get_response ( request ) # Code to be exe ... f . get_response = get_response # One-time configuration and initialization. def __call__ ( self , request ): # Code to be executed for each request before # the view (and later middleware) are called. response = self . get_response ( request ) # Code to ... be executed for each request/response after # the view is called. return response Django によって渡される get_response 呼び出し可能オブ ... ... hat might need it. Ordering of tests ¶ In order to make sure all TestCase code starts with a clean database, tests are now executed in the following order: First, all unit tests (including unittest.TestCase , SimpleTestCase , TestCase and TransactionTest ... nal state are run. This should not cause any problems unless you have existing doctests which assume a TransactionTestCase executed earlier left some database state behind or unit tests that rely on some form of state being preserved after the execution ... ... xecuting queries. select_for_update() requires a transaction ¶ Historically, queries that use select_for_update() could be executed in autocommit mode, outside of a transaction. Before Django 1.6, Django's automatic transactions mode allowed this to be u ... 2026年10月08日