Consumers¶
- class djangochannelsrestframework.consumers.APIConsumerMetaclass(name, bases, body)[source]¶
Metaclass that records action methods
- class djangochannelsrestframework.consumers.AsyncAPIConsumer(*args, **kwargs)[source]¶
Be very inspired by django rest framework ViewSets
- async check_permissions(action: str, **kwargs)[source]¶
Check if the action should be permitted. Raises an appropriate exception if the request is not permitted.
- async get_permissions(action: str, **kwargs)[source]¶
Instantiates and returns the list of permissions that this view requires.
- djangochannelsrestframework.consumers.view_as_consumer(wrapped_view: Callable[[django.http.request.HttpRequest], django.http.response.HttpResponse], mapped_actions: Optional[Dict[str, str]] = None) → djangochannelsrestframework.consumers.DjangoViewAsConsumer[source]¶
- Wrap a django View so that it will be triggered by actions over this json
websocket consumer.