title: Django persistent API connections between requests
body: <p>So I have a lot of internal and external APIs that are called on basically each request. This means that there's a lot of setting up connections to these APIs. Is there a way of creating a persistent connection object that can be shared between requests?</p>
  
  <p>So I'd like to replace:</p>
  
  <pre><code>def a(request):
      c = api.connect()
      c.call_function()
  </code></pre>
  
  <p>With:</p>
  
  <pre><code>def b(request):
      // use existing connection object from earlier request
      c.call_function()
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>I'm also not sure how big the gain would be but I don't mind doing some benchmarking once I have a first solution.</p>