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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file django-requests-api-0.3.2.tar.gz.

File metadata

  • Download URL: django-requests-api-0.3.2.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for django-requests-api-0.3.2.tar.gz
Algorithm Hash digest
SHA256 8486db7db4582a2b4ec9f8ca318b679b0528f810dd2df7d17de2e5c697bd1d19
MD5 f0dfc32367e5ce3393100393f4138711
BLAKE2b-256 905b7bf50c713b0b8c9ba06d9cc3cb235185009ea24d1010c701f393ea8ba6c5

See more details on using hashes here.

File details

Details for the file django_requests_api-0.3.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_requests_api-0.3.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 949dff78333b241841230c0af593818857a330db1fb574b3924e89c7bc25b03a
MD5 3344603c2db38acd51651e55fc26046f
BLAKE2b-256 8ccb0a69d9a772939d95a832493cba5ecf2dd5293f44f5ea16257dd638c6663a

See more details on using hashes here.

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