title: How to call a django view function from external python script
body: <p>Here is how my views.py method looks like:</p>
  
  <pre><code>def save(request):
      if request.method == 'POST':
          post = json.loads(request.body)
          post['id'] = int(post['id'])
          post['desc'] = post['description']
          ....
          ....
      return HttpResponse(json.dumps({'message': message, 'saved_item': saved_id}))
  </code></pre>
  
  <p>Now I have a requirement to call this save method from outside the django project directory. I believe this can be done by importing this views.py file somehow but I'm not sure how to provide request as a parameter to this method.</p>
  
  <p>Also this save method does some interaction with <strong><em>models.py</em></strong> file as well, to save an item into db.</p>