rest_framework_channels package

Subpackages

Submodules

rest_framework_channels.consumers module

rest_framework_channels.decorators module

rest_framework_channels.decorators.async_action(**kwargs)

Set the method as async action. Note that use async_to_sync if you call the method decorated by this decorator in sync method

Parameters:
  • mode (str) – The available modes are [‘response’, ‘broadcast’, ‘none’] ‘response’: Send the response to the user sending this action ‘broadcast’: Broadcast the response to the users in the specific group ‘none’: Do nothing at all

  • broadcast_type (str) – The type for broadcasting. If you specify this variable, use ‘_general.broadcast’

  • send_response_in_broadcast (bool) – Whether to send the response in broadcast mode, default to True

rest_framework_channels.exceptions module

exception rest_framework_channels.exceptions.ActionMissingException(detail=None, code=None)

Bases: APIException

default_code = 'method_not_allowed'
default_detail
status_code = 405
exception rest_framework_channels.exceptions.RouteMissingException(detail=None, code=None)

Bases: APIException

default_code = 'method_not_allowed'
default_detail
status_code = 404

rest_framework_channels.generics module

rest_framework_channels.handlers module

rest_framework_channels.mixins module

class rest_framework_channels.mixins.CreateModelMixin

Bases: object

Create a model instance.

async create(data, *args, **kwargs)
perform_create(serializer)
class rest_framework_channels.mixins.DestroyModelMixin

Bases: object

Destroy a model instance.

async destroy(*args, **kwargs)
perform_destroy(instance)
class rest_framework_channels.mixins.ListModelMixin

Bases: object

List a queryset.

async list(*args, **kwargs)
class rest_framework_channels.mixins.RetrieveModelMixin

Bases: object

Retrieve a model instance.

async retrieve(*args, **kwargs)
class rest_framework_channels.mixins.UpdateModelMixin

Bases: object

Update a model instance.

async partial_update(data, *args, **kwargs)
perform_update(serializer)
async update(data, *args, **kwargs)

rest_framework_channels.permissions module

rest_framework_channels.routings module

class rest_framework_channels.routings.RoutingManager

Bases: object

append(pattern: URLPattern) None

Add new route to be managed

Parameters:

pattern (URLPattern) – The URLPattern instance

async resolve(route: str, scope: dict, receive: Callable, send: Callable) AsyncActionHandler

Resolve a given route

Parameters:
  • route (str) – The route path to be resolved

  • scope (dict) – The scope dict

  • receive (Callable) – The recieve function to be passed into a matched action handler

  • send (Callable) – The send function to be passed into a matched action handler

Returns:

The matched action handler

Return type:

AsyncActionHandler

rest_framework_channels.settings module

class rest_framework_channels.settings.APISettings(user_settings=None, defaults=None, import_strings=None)

Bases: object

reload()
property user_settings
rest_framework_channels.settings.reload_api_settings(*args, **kwargs)

rest_framework_channels.utils module

Module contents