title: How do I call a function when I make a post request at Python?
body: <p>I programmed using the django rest framework.
  Since DRF is CRUD automatic, I created a view as shown below.</p>
  
  <pre><code>class PostViewSet(viewsets.ModelViewSet):
    permission_classes = [permissions.IsAuthenticatedOrReadOnly]
    serializer_class = PostSerializer
    queryset = AllfindPost.objects.all()
  </code></pre>
  
  <p>By the way, I would like to call the following functions when I make a post request.</p>
  
  <pre><code>def send_fcm_notification(ids, title, body):
  
      url = 'https://fcm.googleapis.com/fcm/send'
  
      headers = {
          'Authorization': 'key=',
          'Content-Type': 'application/json; UTF-8',
      }
  
      content = {
          'registration_ids': '',
          'notification': {
              'title': 'title',
              'body': 'body'
          }
      }
  
      requests.post(url, data=json.dumps(content), headers=headers)
  </code></pre>
  
  <p>What should I do?</p>