Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Simple presence boilerplate for django-channels 2 and channel redis backend.

Project description


Simple presence boilerplate for django-channels 2 and channel redis backend.


`pip install django-channels-presence2`


Create presence for consumer:

`self.presence = await ChannelPresence.create_from_consumer(self, groups=(PUBLICATIONS_SCHEDULE_GROUP,))`

Example of create:

`class Consumer(AsyncJsonWebsocketConsumer):
async def connect(self):
self.presence = await ChannelPresence.create_from_consumer(self, groups=(CONSUMER_GROUP,))`

Groups are needed to send join and leave messages.
Learn more about groups:

Join user:

`await self.presence.join()`

Leave user:

`await self.presence.leave()`

Get users:

`await self.presence.get_users(GROUP)`


'user': SimpleLazyObject of User,
'is_active': True or False
'present_at': Datetime

To set the activity expired time use `EXPIRED_USER_ACTIVITY` in django settings.

Project details

Download files

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

Files for django-channels-presence2, version 0.0.4a0
Filename, size File type Python version Upload date Hashes
Filename, size django_channels_presence2-0.0.4a0-py3-none-any.whl (4.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-channels-presence2-0.0.4a0.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page