Skip to main content

Django application to provide simple and shared requests client.

Project description

django-requests-api PyPi license

PyPi status PyPi version PyPi python version PyPi downloads PyPi downloads PyPi downloads

GitHub GitHub release GitHub release

Test codecov.io pre-commit.ci status gitthub.com

Check Demo Project

  • Browser the demo app on-line on Heroku
  • Check the demo repo on GitHub

Requirements

  • Python 3.8+ supported.
  • Django 3.2+ supported.

Setup

  1. Install from pip:
pip install django-requests-api
  1. Modify settings.py by adding the app to INSTALLED_APPS:
INSTALLED_APPS = (
    # ...
    "requests_api",
    # ...
)

Usage

from requests_api import RequestsApi

client = RequestsApi("https://api.publicapis.org")
r = client.get("/entries")
print(r.json())

github = RequestsApi("https://api.github.com", headers={"Authorization": "token abcdef"})
r = github.get("/user", headers={"Accept": "application/json"})
print(r.text)

Run Example Project

git clone --depth=50 --branch=django-requests-api https://github.com/DLRSP/example.git DLRSP/example
cd DLRSP/example
python manage.py runserver

Now browser the app @ http://127.0.0.1:8000

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-requests-api-0.3.2.tar.gz (31.8 kB view hashes)

Uploaded Source

Built Distribution

django_requests_api-0.3.2-py2.py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page