Skip to main content

Django channels endpoints

Project description

Django channels endpoints

This package provides endpoints as functions for django-channels package. Like this:

from channels_endpoints.main import endpoint, Response
from django.contrib.auth.models import User
users_logger = logging.getLogger('users')


@endpoint(logger=users_logger, permissions=[UsersPermissions], timeout=42)
async def get_users(request):
    def _get():
        return User.objects.all()
    return Response(
        request,
        await sync_to_async(_get)()
    )

Installation

pip install channels-endpoints

Usage

See django project example chat_project

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

channels_endpoints-1.0.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

channels_endpoints-1.0-py3-none-any.whl (8.4 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