Send notifications through DRF - django

Hello I'm building a RESTfull application using Django Rest Framework.
The clients are android application and react application.
I need to send a time based notification to users.

To send push notifications you can use the well supported https://github.com/jazzband/django-push-notifications app

It is not necessary to use FCM for android. I personally like to use Firebase Cloud Messaging (FCM). If you want to give it a try i suggest to use the pyfcm library https://pypi.org/project/pyfcm/
.
It's pretty straight forward and well documented. As for the authentication problems in the django-rest-framework, please be more specific.

Related

How are messaging apps like Whatsapp or Messenger built?

I'm trying to build a mobile messaging app like Whatsapp and don't know where to start. In the first place, I don't know how messaging apps send messages between users. What type of protocol do they use? Do they use websockets? Do they use some sort of long polling? I mean what I really want to know is how the server works and is there a name to this sort of communication?
FYI, I was looking to try and build a messaging app with a Django (something like django channels) server and React native for the mobile app.
Thanks for reading.
Yes to create a chat application like messenger or WhatsApp you will need to use websocket, also a cache like redis
If you want to create a chat backend with django and django channels you can follow this repository, this is pretty basic. You can use this repo to build a chat api, which you can use with a mobile app/desktop app as well as a web app
https://github.com/khan-asfi-reza/ChatAPI
This is a minimalistic Chat Api built with django, django rest framework, django channels.
And if you want something more extra like read/seen feature, this following repo will be best
https://github.com/Bearle/django_private_chat2
And for react native app, you can see the following repo, this codebase might be a bit complex for beginners
https://github.com/cometchat-pro/react-native-chat-app.git

Integrate sms API with django prject

i have my django project and i want to integrate it with Etisalat API to be able to send sms to client ,anyone can help me out to integrate SMS API with my project ?
Twilio supports sending SMS messages, and I believe it can also carry out certain actions on receiving an SMS. It has a Python API client so it should in principle be practical to integrate it with your application.
I see PHP library with Etisalat, i can help you get it integrated with your django projects with API, I am expert in Twilio API too, you can reach me by sending mail to simer169 at gmail

How create application backend in django and create a api so that other developers can use that as well

I just started learning Django and wanted to make an application with API (probably REST) endpoints so that other developers can use it as well (like GitHub API), and I could connect it to my react app and android app. I want my backend to be on a different server and do not want to build my react app integrated with Django backend using the REST Framework.
Can anyone just give me the general idea of what I need to do?
P.S. Sorry in advance if my question sounds silly, I am still new to backend.
Creating a Django REST API should be your first step. This is pretty simple if you already have a Django app running, and will allow your React app or Android app to connect and access data.
Authentication is a step beyond. You may want to look into implementing authentication on the server you will be hosting your back end on. You can also read through this article for some guidance on implementing auth on the DRF side.
Best of luck!
First off all you can start from this.
https://www.django-rest-framework.org/tutorial/quickstart/

Firebase for Push Notifications only

I want to develop a web application with a database using Django/Grails/Express
I want to use Firebase just for sending Push Notifications to an Iphone. Do i need develop the webapplication (including the database) in firebase or can i develop the web application using Django/Grails/Express and use Firebase just for sending Push Notifications?
Do all web frameworks (Django/Grails/Express) support Firebase? Will Firebase be free to use in my case?
EDIT: How to i use Firebase with Django/Grails/Express? Is there an API or library i need to download?
Thank you in advance!
You can pick and choose which Firebase products you wish to use in your app. You may use as many or as few as you want. There is no obligation to use anything that you don't want to use. There is no charge for using Firebase Cloud Messaging in your app.
In this url https://cloud.google.com/community/tutorials/grails3-send-push-notification-using-firebase-cloud-messaging you can read about the process for sending push notifications using grails as backend

How to implement websocket for push message using django-rest-framework as backend and angular2 as frontend?

I want to implement websocket to send push notification to client.
I am using django-rest framework as backend and angular2 as frontend.
I know that django support HTTP protocol only. And I am unable to get
any such links,blogs or resource which helps me to achieve websocket
completely.
Currently I am using polling from frontend.
There are some third party apps which I found and may be useful for
implementing push message. They are...
pywebsocket
tornado
Django Channels
I don't think showing some code is significant here because i have no
code relevent to implementation of websocket.
So can you people suggest me the best way to implement this thing.Any
link,any blog or any code which may help.
One possible solution is to deploy a separate Tornado app which communicates with Front-end using WebSocket. Then, whenever the Django Back-end wants to send a push notification to the Front-end, it asks the Tornado app and Tornado app delivers the push notification to Front-end.
I have described the process in slightly more detail in this answer of mine. You might want to have a look.