... a piece of synchronous middleware sits between an ASGI server and an async view, Django adapts it by running it in its own thread; see パフォーマンス for the cost trade-off. Django's bundled middleware supports both sync and async . Third-party middlew ... sync() でラップする必要があります。 from asgiref.sync import sync_to_async results = await sync_to_async ( sync_function , thread_sensitive = True )( pk = 123 ) 非同期ビューから、同期的な Django の機能を誤って呼び出そうとすると、Django の 非同期セーフテ ... measured in milliseconds, this is rarely visible in itself, but can become so under GIL contention as the number of active threads grows. If you find yourself wrapping individual rows or operations in a tight loop, restructure your code so the loop run ... ... ature. The force_rhr() , reverse_geom() , and geohash() GeoQuerySet methods are new. The GEOS interface was updated to use thread-safe C library functions when available on the platform. The GDAL interface now allows the user to set a spatial_filter on ... ues. Stateful template tags Template tags that store rendering state on their Node subclass have always been vulnerable to thread-safety and other issues; as of Django 1.2, however, they may also cause problems when used with the new cached template lo ... that come from third party packages, or from your own code, you should ensure that the Node implementation for each tag is thread-safe. For more information, see template tag thread safety considerations . Django のテンプレートタグの実装が スレッドセー ... ... stead. If you were testing for MySQLdb.OperationalError , you'll need to update your except clauses. Database connection's thread-locality DatabaseWrapper objects (i.e. the connection objects referenced by django.db.connection and django.db.connections ... ["some_alias"] ) used to be thread-local. They are now global objects in order to be potentially shared between multiple threads. While the individual connec ... tion objects are now global, the django.db.connections dictionary referencing those objects is still thread-local. Therefore if you just use the ORM or DatabaseWrapper.cursor() then the behavior is still the same as before. Note, ... ... tions (coroutines). BaseTaskBackend. supports_get_result Whether the backend supports retrieving Task results from another thread after they have been enqueued. BaseTaskBackend. supports_priority Whether the backend supports executing Tasks as ordered ... sn't officially support get_result() , despite implementing the API, since the result cannot be retrieved from a different thread. [ 2 ] The DummyBackend has supports_priority=True so that it can be used as a drop-in replacement in tests. Since this ba ... ... em storage and file-based cache backends used the process umask to control permissions when creating directories. In multi-threaded environments, one thread's temporary umask change can affect other threads' file and directory creation, resulting in fi ... ... em storage and file-based cache backends used the process umask to control permissions when creating directories. In multi-threaded environments, one thread's temporary umask change can affect other threads' file and directory creation, resulting in fi ... ... To read more about the decision and to let us know if this will be problematic for you, please read the django-developers thread . バグ修正 Fixed incorrect unique_together field name generation by inspectdb ( #25274 ). Corrected __len query lookup on ... ... em storage and file-based cache backends used the process umask to control permissions when creating directories. In multi-threaded environments, one thread's temporary umask change can affect other threads' file and directory creation, resulting in fi ... ... ed a crash when passing deprecated keyword arguments to a queryset in TemplateView.get_context_data() ( #31877 ). Enforced thread sensitivity of the MiddlewareMixin.process_request() and process_response() hooks when in an async context ( #31905 ). Fix ... ... nfigured in CACHES is now available via django.core.cache.caches . This dict-like object provides a different instance per thread. It supersedes django.core.cache.get_cache() which is now deprecated. If you instantiate cache backends directly, be aware ... that they aren't thread-safe any more, as django.core.cache.caches now yields different instances per thread. Defining the TIMEOUT argument of the ... 2026年10月08日