... cost (see パフォーマンス ), and without the ability to have efficient long-running requests. Many parts of Django provide asynchronous APIs, including the ORM , the cache framework, authentication, sessions, and signals. For other code, the sync_to_async() ... ます ( __init__() でも as_view() でもないことに注意)。 注釈 Django uses inspect.iscoroutinefunction to test if your view is asynchronous or not. If you implement your own method of returning a coroutine, ensure you use inspect.markcoroutinefunction so this fu ... スタイプが使えます。 もしこれらを利用したい場合は、代わりに ASGI を使って Django をデプロイする必要があります。 注釈 A fully asynchronous request stack requires async middleware end-to-end. Where a piece of synchronous middleware sits between an ASGI server an ... ... cost (see パフォーマンス ), and without the ability to have efficient long-running requests. Many parts of Django provide asynchronous APIs, including the ORM , the cache framework, authentication, sessions, and signals. For other code, the sync_to_async() ... ます ( __init__() でも as_view() でもないことに注意)。 注釈 Django uses inspect.iscoroutinefunction to test if your view is asynchronous or not. If you implement your own method of returning a coroutine, ensure you use inspect.markcoroutinefunction so this fu ... スタイプが使えます。 もしこれらを利用したい場合は、代わりに ASGI を使って Django をデプロイする必要があります。 注釈 A fully asynchronous request stack requires async middleware end-to-end. Where a piece of synchronous middleware sits between an ASGI server an ... ... AsyncPaginator ( object_list , per_page , orphans = 0 , allow_empty_first_page = True , error_messages = None ) [ソース] ¶ Asynchronous version of Paginator . AsyncPaginator has the same attributes and signatures as Paginator , with the following exceptions: ... The attribute Paginator.count is supported as an asynchronous method AsyncPaginator.acount() . The attribute Paginator.num_pages is supported as an asynchronous method AsyncPaginator.a ... num_pages() . The attribute Paginator.page_range is supported as an asynchronous method AsyncPaginator.apage_range() . AsyncPaginator has asynchronous versions of the same methods as Paginator , using an ... ... AsyncPaginator ( object_list , per_page , orphans = 0 , allow_empty_first_page = True , error_messages = None ) [ソース] ¶ Asynchronous version of Paginator . AsyncPaginator has the same attributes and signatures as Paginator , with the following exceptions: ... The attribute Paginator.count is supported as an asynchronous method AsyncPaginator.acount() . The attribute Paginator.num_pages is supported as an asynchronous method AsyncPaginator.a ... num_pages() . The attribute Paginator.page_range is supported as an asynchronous method AsyncPaginator.apage_range() . AsyncPaginator has asynchronous versions of the same methods as Paginator , using an ... ... 。各バージョン系列の最新リリースのみを公式にサポートし、最新リリースを使用することを 強く推奨 します。 Django 3.1 の新機能 ¶ Asynchronous views and middleware support ¶ Django now supports a fully asynchronous request path, including: Asynchronous views Asynch ... ronous middleware Asynchronous tests and test client To get started with async views, you need to declare a view using async def : async def my_view ( re ... quest ): await asyncio . sleep ( 0.5 ) return HttpResponse ( "Hello, async world!" ) All asynchronous features are supported whether you are running under WSGI or ASGI mode. However, there will be performance penalties using ... ... 。各バージョン系列の最新リリースのみを公式にサポートし、最新リリースを使用することを 強く推奨 します。 Django 3.1 の新機能 ¶ Asynchronous views and middleware support ¶ Django now supports a fully asynchronous request path, including: Asynchronous views Asynch ... ronous middleware Asynchronous tests and test client To get started with async views, you need to declare a view using async def : async def my_view ( re ... quest ): await asyncio . sleep ( 0.5 ) return HttpResponse ( "Hello, async world!" ) All asynchronous features are supported whether you are running under WSGI or ASGI mode. However, there will be performance penalties using ... ... orld!" ) 詳細は 非同期のクラスベース・ビュー を参照してください。 非同期の ORM インターフェース ¶ QuerySet now provides an asynchronous interface for all data access operations. These are named as-per the existing synchronous operations but with an a prefix, ... for example acreate() , aget() , and so on. The new interface allows you to write asynchronous code without needing to wrap ORM operations in sync_to_async() : async for author in Author . objects . filter ( name__sta ... rst () Note that, at this stage, the underlying database operations remain synchronous, with contributions ongoing to push asynchronous support down into the SQL compiler, and integrate asynchronous database drivers. The new asynchronous queryset interface c ... ... orld!" ) 詳細は 非同期のクラスベース・ビュー を参照してください。 非同期の ORM インターフェース ¶ QuerySet now provides an asynchronous interface for all data access operations. These are named as-per the existing synchronous operations but with an a prefix, ... for example acreate() , aget() , and so on. The new interface allows you to write asynchronous code without needing to wrap ORM operations in sync_to_async() : async for author in Author . objects . filter ( name__sta ... rst () Note that, at this stage, the underlying database operations remain synchronous, with contributions ongoing to push asynchronous support down into the SQL compiler, and integrate asynchronous database drivers. The new asynchronous queryset interface c ... ... owever. At this stage async support only applies to the outer ASGI application. Internally everything remains synchronous. Asynchronous middleware, views, etc. are not yet supported. You can, however, use ASGI middleware around Django's application, allowing ... with other ASGI frameworks. There is no need to switch your applications over unless you want to start experimenting with asynchronous code, but we have documentation on deploying with ASGI if you want to learn more. Note that as a side-effect of this chang ... e, Django is now aware of asynchronous event loops and will block you calling code marked as "async unsafe" - such as ORM operations - from an asynchronous conte ... ... owever. At this stage async support only applies to the outer ASGI application. Internally everything remains synchronous. Asynchronous middleware, views, etc. are not yet supported. You can, however, use ASGI middleware around Django's application, allowing ... with other ASGI frameworks. There is no need to switch your applications over unless you want to start experimenting with asynchronous code, but we have documentation on deploying with ASGI if you want to learn more. Note that as a side-effect of this chang ... e, Django is now aware of asynchronous event loops and will block you calling code marked as "async unsafe" - such as ORM operations - from an asynchronous conte ... 2026年10月08日