Skip to main content

Async views and viewsets for DRF

Project description

Django REST framework async views

How to use

from async_drf.mixins import AsyncMixin, AsyncListModelMixin
from async_drf.viewsets import AsyncGenericViewSet

class ProductsViewSet(AsyncMixin, AsyncGenericViewSet, AsyncListModelMixin):
	serializer_class = ProductsSerializer
	queryset = ProductModel.objects.prefetch_related().all()

	async def list(self, request: Request, *args, **kwargs):
	    # do async stuff here
		return Response(data=data)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

async-drf-0.0.3.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

async_drf-0.0.3-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page