I am building a mobile app using Django Rest Framework, Flutter, and MongoDB. In that app users can view posts posted by other users. In my Django app, I don't have any notification model (and honestly don't really know how to use that either!). In Django, I have created endpoints to create posts
@api_view(['POST'])
def createPost(request):
code/logic...
, and to retrieve posts
class blogsViewSet(ModelViewSet):
queryset = Posts.objects.all()
serializer_class = PostSerializer
pagination_class = pagination.CustomPagination
def list(self, request, *args, **kwargs):
uid = request.META.get('HTTP_DATA')
context = {"user": uid}
queryset = Posts.objects.all().order_by('postID')
paginatedResult = self.paginate_queryset(queryset)
serializer = self.get_serializer(paginatedResult, many=True, context= context)
return Response(serializer.data)
Now in my app, lets say I have two users: User A, and User B. now if both of them are using the app at the same time and user A creates a new post, I want user B to be notified and showed that new post immediately, without the user B having to reload the page himself/herself.
Now my question is, can I achieve this by using Django channel only, or do I have to use Redis (or any similar service). If yes, then how?
Thanks!