Django application to provide simple and shared requests client.
Project description
django-requests-api
GitHub
Test
Check Demo Project
Requirements
- Python 3.8+ supported.
- Django 3.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.3.2.tar.gz
(31.8 kB
view details)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8486db7db4582a2b4ec9f8ca318b679b0528f810dd2df7d17de2e5c697bd1d19 |
|
MD5 | f0dfc32367e5ce3393100393f4138711 |
|
BLAKE2b-256 | 905b7bf50c713b0b8c9ba06d9cc3cb235185009ea24d1010c701f393ea8ba6c5 |
File details
Details for the file django_requests_api-0.3.2-py2.py3-none-any.whl
.
File metadata
- Download URL: django_requests_api-0.3.2-py2.py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 949dff78333b241841230c0af593818857a330db1fb574b3924e89c7bc25b03a |
|
MD5 | 3344603c2db38acd51651e55fc26046f |
|
BLAKE2b-256 | 8ccb0a69d9a772939d95a832493cba5ecf2dd5293f44f5ea16257dd638c6663a |