title: API call from one Django site to another
body: <p>I'm pretty new to Python/Django but I have set up an REST API for one website (siteA.com), and would like another website (siteB.com) to be able to call this API and show some results.  For this I have added the Django REST Framework and Django Auth2 Provider to siteA.  I can now call the API using curl to get the access token:</p>
  
  <pre><code>curl -X POST -d "client_id=CLIENT_ID&amp;client_secret=CLIENT_SECRET&amp;grant_type=password&amp;username=USERNAME&amp;password=PASSWORD" http://www.siteA.com/oauth2/access_token   [1]
  </code></pre>
  
  <p>This gives the response I want:</p>
  
  <pre><code>{"access_token": "72x63615xe29f4xfdadexbcd77x27b5fx0bceexx", "scope": "read", "expires_in": 86399, "refresh_token": "5fx80dx320cx3abe7d0x27d5f1x64e7x413x0f70"}
  </code></pre>
  
  <p>Using the access token I get I can now call the API:</p>
  
  <pre><code>curl -v -H "Authorization: Bearer 72x63615xe29f4xfdadexbcd77x27b5fx0bceexx" "http://www.siteA.com/api/?q=SOMESTRING&amp;per_page=3&amp;page=1&amp;sort=random"     [2]
  </code></pre>
  
  <p>Which gives me a JSON response with 3 results for the query string 'SOMESTRING'.</p>
  
  <p>That all works fine, but now I wanna make these calls from within siteB.com.  In other words, I want to make a page that if called with a certain seach query first checks if there's an access token like in [1], and then get the search results [2] and show them in JSON format.  I just have no idea how to do it.  Tried to use OAuth2 from requests_oauth2 but simply don't know the right way to translate the curl statements into Python.  Any help?</p>