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)
Built Distribution
Close
Hashes for channels_endpoints-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2aeb83346c022bdf3b57aff2a4369e5eec9e944a43f604f4fa1205457aad832 |
|
MD5 | baf39011d39c13c722a56af2981c145a |
|
BLAKE2b-256 | 202afbcea09a03509a1547e8d0b3236cae0e11a4942fda11edc519d81dcfea10 |