6๐
Django REST framework is for creating API in django using built in django functionalities to retrieve request and serve response.
Django by itself doesnโt support any protocol that will allow push notifications to be sent to client, so DRF also wonโt do that.
To create push notifications you have to use websockets, there are some third-party packages adding support of websockets to django. One of them is django-websocket-redis
3๐
If you are looking for push notification on the web (using web socket), you can try to use Firebase Cloud messaging (FCM, Firebase is free with certain usage threshold). What you need is adding code to your django server to request Firebase to send notifications.
If you are looking for push notifications on mobile devices, django-push-notifications package looks good, it even provide support for DRF to keep track of devices. On Android, this will also use FCM as well.
- Recursive crawling with Python and Scrapy
- Update model instance with dynamic field names
- Creating custom Field Lookups in Django
- AttributeError: 'property' object has no attribute 'admin_order_field'
3๐
django-push-notifications is the one you are looking for. It is simple and can be implemented with few lines of code. It can be used for all android, iOS and web push notifications.
- Django Error Logging: Adding request header, body and user information
- CharField max_length 2^n vs 2^n-1
- How to import and run a django function at the command line
- How to add data-attribute to django modelform modelchoicefield
0๐
My Personal Favourite for this Purpose is: Django Notification! And Django Pushy!
Other Packages: django-push-notifications Django Activity Stream
Try using the django-instapush package. It is easily available to install via pip. This support all sql databases and also mongoDB via mongoengine to store device information. It has built-in models that can be used to store device information so this will work out of the box. Here is a little tutorial on sending django push notifications using django instapush.
You can Also use:
https://pypi.org/project/django-sns-mobile-push-notification/
You can also try with some other push providers. Infobip Push has some new things, for example you can track users by their locations and send push whenever they are apporaching some areas
- DRF test client unable to post list of JSON
- Python multiprocessing Pool hangs on ubuntu server
- Django: time zone issue
0๐
If you intend to use WebSocket to implement your own notification, you can check out channels
- How to run multiple Django sites on Nginx and uWSGI?
- Django Heroku โ ModuleNotFoundError: No module named 'django_heroku'
- Why does JSON returned from the django rest framework have forward slashes in the response?
- Multiple sites using Django and mod_wsgi on Apache
- Api key and Django Rest Framework Auth Token
0๐
If you project DRF was structured without asynchronous process in mind. You can try out django channels rest framework. you can easily pass asynch classes to you viewsets and make your endpoints behave like an asynchronous porcess.
- Django v1.6 debug-toolbar Middleware Error No .rsplit()
- Python Django Asynchronous Request handling
- Use Django template syntax in a css file