# django-requests-api [![PyPi license](https://img.shields.io/pypi/l/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)
[![PyPi status](https://img.shields.io/pypi/status/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)
[![PyPi version](https://img.shields.io/pypi/v/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)
[![PyPi python version](https://img.shields.io/pypi/pyversions/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)
[![PyPi downloads](https://img.shields.io/pypi/dm/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)
[![PyPi downloads](https://img.shields.io/pypi/dw/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)
[![PyPi downloads](https://img.shields.io/pypi/dd/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)
## GitHub ![GitHub release](https://img.shields.io/github/tag/DLRSP/django-requests-api.svg) ![GitHub release](https://img.shields.io/github/release/DLRSP/django-requests-api.svg)
## Test [![codecov.io](https://codecov.io/github/DLRSP/django-requests-api/coverage.svg?branch=master)](https://codecov.io/github/DLRSP/django-requests-api?branch=master) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/DLRSP/django-requests-api/master.svg)](https://results.pre-commit.ci/latest/github/DLRSP/django-requests-api/master) [![gitthub.com](https://github.com/DLRSP/django-requests-api/actions/workflows/ci.yml/badge.svg)](https://github.com/DLRSP/django-requests-api/actions/workflows/ci.yml)
## Check Demo Project
* Browser the demo app on-line on [Heroku](https://django-requests-api.herokuapp.com/)
* Check the demo repo on [GitHub](https://github.com/DLRSP/example/tree/django-requests-api)
## Requirements
- Python 3.8+ supported.
- Django 3.2+ supported.
## Setup
1. Install from **pip**:
```shell
pip install django-requests-api
```
2. Modify `settings.py` by adding the app to `INSTALLED_APPS`:
```python
INSTALLED_APPS = (
# ...
"requests_api",
# ...
)
```
## Usage
```shell
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
```shell
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
Raw data
{
"_id": null,
"home_page": "https://github.com/DLRSP/django-requests-api",
"name": "django-requests-api",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "django,requests,API,privacy,cookie",
"author": "DLRSP",
"author_email": "dlrsp.dev@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/90/5b/7bf50c713b0b8c9ba06d9cc3cb235185009ea24d1010c701f393ea8ba6c5/django-requests-api-0.3.2.tar.gz",
"platform": null,
"description": "# django-requests-api [![PyPi license](https://img.shields.io/pypi/l/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)\n\n[![PyPi status](https://img.shields.io/pypi/status/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)\n[![PyPi version](https://img.shields.io/pypi/v/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)\n[![PyPi python version](https://img.shields.io/pypi/pyversions/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)\n[![PyPi downloads](https://img.shields.io/pypi/dm/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)\n[![PyPi downloads](https://img.shields.io/pypi/dw/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)\n[![PyPi downloads](https://img.shields.io/pypi/dd/django-requests-api.svg)](https://pypi.python.org/pypi/django-requests-api)\n\n## GitHub ![GitHub release](https://img.shields.io/github/tag/DLRSP/django-requests-api.svg) ![GitHub release](https://img.shields.io/github/release/DLRSP/django-requests-api.svg)\n\n## Test [![codecov.io](https://codecov.io/github/DLRSP/django-requests-api/coverage.svg?branch=master)](https://codecov.io/github/DLRSP/django-requests-api?branch=master) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/DLRSP/django-requests-api/master.svg)](https://results.pre-commit.ci/latest/github/DLRSP/django-requests-api/master) [![gitthub.com](https://github.com/DLRSP/django-requests-api/actions/workflows/ci.yml/badge.svg)](https://github.com/DLRSP/django-requests-api/actions/workflows/ci.yml)\n\n## Check Demo Project\n* Browser the demo app on-line on [Heroku](https://django-requests-api.herokuapp.com/)\n* Check the demo repo on [GitHub](https://github.com/DLRSP/example/tree/django-requests-api)\n\n## Requirements\n- Python 3.8+ supported.\n- Django 3.2+ supported.\n\n## Setup\n1. Install from **pip**:\n```shell\npip install django-requests-api\n```\n\n2. Modify `settings.py` by adding the app to `INSTALLED_APPS`:\n```python\nINSTALLED_APPS = (\n # ...\n \"requests_api\",\n # ...\n)\n```\n\n## Usage\n\n```shell\nfrom requests_api import RequestsApi\n\nclient = RequestsApi(\"https://api.publicapis.org\")\nr = client.get(\"/entries\")\nprint(r.json())\n\ngithub = RequestsApi(\"https://api.github.com\", headers={\"Authorization\": \"token abcdef\"})\nr = github.get(\"/user\", headers={\"Accept\": \"application/json\"})\nprint(r.text)\n```\n\n## Run Example Project\n\n```shell\ngit clone --depth=50 --branch=django-requests-api https://github.com/DLRSP/example.git DLRSP/example\ncd DLRSP/example\npython manage.py runserver\n```\n\nNow browser the app @ http://127.0.0.1:8000\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Django application to provide simple and shared requests client.",
"version": "0.3.2",
"project_urls": {
"Homepage": "https://github.com/DLRSP/django-requests-api"
},
"split_keywords": [
"django",
"requests",
"api",
"privacy",
"cookie"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8ccb0a69d9a772939d95a832493cba5ecf2dd5293f44f5ea16257dd638c6663a",
"md5": "3344603c2db38acd51651e55fc26046f",
"sha256": "949dff78333b241841230c0af593818857a330db1fb574b3924e89c7bc25b03a"
},
"downloads": -1,
"filename": "django_requests_api-0.3.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "3344603c2db38acd51651e55fc26046f",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.8",
"size": 4639,
"upload_time": "2023-06-27T08:30:38",
"upload_time_iso_8601": "2023-06-27T08:30:38.287005Z",
"url": "https://files.pythonhosted.org/packages/8c/cb/0a69d9a772939d95a832493cba5ecf2dd5293f44f5ea16257dd638c6663a/django_requests_api-0.3.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "905b7bf50c713b0b8c9ba06d9cc3cb235185009ea24d1010c701f393ea8ba6c5",
"md5": "f0dfc32367e5ce3393100393f4138711",
"sha256": "8486db7db4582a2b4ec9f8ca318b679b0528f810dd2df7d17de2e5c697bd1d19"
},
"downloads": -1,
"filename": "django-requests-api-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "f0dfc32367e5ce3393100393f4138711",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 31788,
"upload_time": "2023-06-27T08:30:39",
"upload_time_iso_8601": "2023-06-27T08:30:39.614197Z",
"url": "https://files.pythonhosted.org/packages/90/5b/7bf50c713b0b8c9ba06d9cc3cb235185009ea24d1010c701f393ea8ba6c5/django-requests-api-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-27 08:30:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DLRSP",
"github_project": "django-requests-api",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "django-requests-api"
}