Django application to provide simple and shared requests client.
Project description
django-requests-api
GitHub
Test
Check Demo Project
Requirements
- Python 3.7 to 3.10 supported.
- Django 3.2 to 4.2 supported.
Setup
- Install from pip:
pip install django-requests-api
- Modify
settings.py
by adding the app toINSTALLED_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
Release history Release notifications | RSS feed
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.2.0.tar.gz
(24.2 kB
view hashes)
Built Distributions
Close
Hashes for django-requests-api-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65c0390910f493e174c806393cfb27cb97f1873a74808c0d904cb0b8f079baea |
|
MD5 | 1fbcb6fc09a96576ce1e5a1a81b874af |
|
BLAKE2b-256 | 4c150cce5f669f655dbd3ba556191661258bdb51e22ec0acb590fed9e66cb639 |
Close
Hashes for django_requests_api-0.2.0-py3.10.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | a55fbfe41386c18779d831ac6f5e0f85e6ea0adfb9ccee1a5e8bec743e92213b |
|
MD5 | aa66d139c39f3674a34189f7958b59db |
|
BLAKE2b-256 | b5cac79aacddef201b4da5d2d52c31e53ac0ba744aacc42b2eb6a1a39dd15f05 |
Close
Hashes for django_requests_api-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa65a78321c86e4b0c54f81817904c0a3469dbe36d1b931c15351048625e5de1 |
|
MD5 | 47dcf0eaa4c74e4d5948ec87ba3882e2 |
|
BLAKE2b-256 | 2a2f2f1da77635dc2a09281da76b5707418d47cc78e60f9a31df63fdbe700be2 |