django-requests-api 0.2.0__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/.bumpversion.cfg +20 -20
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/.pre-commit-config.yaml +48 -48
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/CHANGELOG.rst +1 -1
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/CONTRIBUTING.md +3 -3
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/LICENSE +21 -21
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/MANIFEST.in +14 -14
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/PKG-INFO +95 -96
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/README.md +59 -59
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/mkdocs.yml +70 -74
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/pyproject.toml +54 -54
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/requirements/docs.in +3 -3
- django-requests-api-0.3.2/requirements/docs.txt +409 -0
- django-requests-api-0.3.2/requirements/py310-django32.txt +216 -0
- django-requests-api-0.3.2/requirements/py310-django42.txt +212 -0
- django-requests-api-0.3.2/requirements/py311-django32.txt +204 -0
- django-requests-api-0.3.2/requirements/py311-django42.txt +200 -0
- django-requests-api-0.3.2/requirements/py38-django32.txt +224 -0
- django-requests-api-0.3.2/requirements/py38-django42.txt +238 -0
- django-requests-api-0.3.2/requirements/py39-django32.txt +224 -0
- django-requests-api-0.3.2/requirements/py39-django42.txt +220 -0
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/requirements/requirements.in +6 -6
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/runtests.py +52 -52
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/setup.cfg +85 -86
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/setup.py +6 -6
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/src/django_requests_api.egg-info/PKG-INFO +95 -96
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/src/django_requests_api.egg-info/SOURCES.txt +5 -9
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/src/django_requests_api.egg-info/not-zip-safe +1 -1
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/src/django_requests_api.egg-info/requires.txt +1 -1
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/src/requests_api/__init__.py +22 -22
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/src/requests_api/apps.py +7 -7
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/src/requests_api/requests_api.py +55 -54
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/tests/settings.py +18 -18
- django-requests-api-0.3.2/tests/test_requests_api.py +31 -0
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/tests/urls.py +2 -2
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/tests/views.py +1 -1
- django-requests-api-0.3.2/tox.ini +34 -0
- django-requests-api-0.2.0/requirements/docs.txt +0 -231
- django-requests-api-0.2.0/requirements/py310-django32.txt +0 -113
- django-requests-api-0.2.0/requirements/py310-django40.txt +0 -109
- django-requests-api-0.2.0/requirements/py311-django32.txt +0 -113
- django-requests-api-0.2.0/requirements/py311-django40.txt +0 -109
- django-requests-api-0.2.0/requirements/py37-django22.txt +0 -124
- django-requests-api-0.2.0/requirements/py37-django32.txt +0 -130
- django-requests-api-0.2.0/requirements/py38-django22.txt +0 -125
- django-requests-api-0.2.0/requirements/py38-django32.txt +0 -129
- django-requests-api-0.2.0/requirements/py38-django40.txt +0 -147
- django-requests-api-0.2.0/requirements/py39-django22.txt +0 -117
- django-requests-api-0.2.0/requirements/py39-django32.txt +0 -121
- django-requests-api-0.2.0/requirements/py39-django40.txt +0 -117
- django-requests-api-0.2.0/tests/test_iubenda.py +0 -20
- django-requests-api-0.2.0/tox.ini +0 -38
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/src/django_requests_api.egg-info/dependency_links.txt +0 -0
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/src/django_requests_api.egg-info/top_level.txt +0 -0
- {django-requests-api-0.2.0 → django-requests-api-0.3.2}/tests/__init__.py +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
[bumpversion]
|
|
2
|
-
commit = True
|
|
3
|
-
tag = False
|
|
4
|
-
current_version = 0.2
|
|
5
|
-
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
|
|
6
|
-
serialize =
|
|
7
|
-
{major}.{minor}.{patch}-{release}
|
|
8
|
-
{major}.{minor}.{patch}
|
|
9
|
-
|
|
10
|
-
[bumpversion:file:setup.cfg]
|
|
11
|
-
|
|
12
|
-
[bumpversion:file:pyproject.toml]
|
|
13
|
-
|
|
14
|
-
[bumpversion:file:src/requests_api/__init__.py]
|
|
15
|
-
|
|
16
|
-
[bumpversion:part:release]
|
|
17
|
-
optional_value = gamma
|
|
18
|
-
values =
|
|
19
|
-
dev
|
|
20
|
-
gamma
|
|
1
|
+
[bumpversion]
|
|
2
|
+
commit = True
|
|
3
|
+
tag = False
|
|
4
|
+
current_version = 0.3.2
|
|
5
|
+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
|
|
6
|
+
serialize =
|
|
7
|
+
{major}.{minor}.{patch}-{release}
|
|
8
|
+
{major}.{minor}.{patch}
|
|
9
|
+
|
|
10
|
+
[bumpversion:file:setup.cfg]
|
|
11
|
+
|
|
12
|
+
[bumpversion:file:pyproject.toml]
|
|
13
|
+
|
|
14
|
+
[bumpversion:file:src/requests_api/__init__.py]
|
|
15
|
+
|
|
16
|
+
[bumpversion:part:release]
|
|
17
|
+
optional_value = gamma
|
|
18
|
+
values =
|
|
19
|
+
dev
|
|
20
|
+
gamma
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
repos:
|
|
2
|
-
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
-
rev: v4.4.0
|
|
4
|
-
hooks:
|
|
5
|
-
- id: check-added-large-files
|
|
6
|
-
- id: check-case-conflict
|
|
7
|
-
- id: check-json
|
|
8
|
-
- id: check-merge-conflict
|
|
9
|
-
- id: check-symlinks
|
|
10
|
-
- id: check-toml
|
|
11
|
-
- id: end-of-file-fixer
|
|
12
|
-
- id: trailing-whitespace
|
|
13
|
-
exclude: .bumpversion.cfg
|
|
14
|
-
- repo: https://github.com/asottile/pyupgrade
|
|
15
|
-
rev: v3.
|
|
16
|
-
hooks:
|
|
17
|
-
- id: pyupgrade
|
|
18
|
-
args: [--py36-plus]
|
|
19
|
-
- repo: https://github.com/psf/black
|
|
20
|
-
rev:
|
|
21
|
-
hooks:
|
|
22
|
-
- id: black
|
|
23
|
-
- repo: https://github.com/asottile/blacken-docs
|
|
24
|
-
rev:
|
|
25
|
-
hooks:
|
|
26
|
-
- id: blacken-docs
|
|
27
|
-
additional_dependencies:
|
|
28
|
-
- black
|
|
29
|
-
- repo: https://github.com/pycqa/isort
|
|
30
|
-
rev:
|
|
31
|
-
hooks:
|
|
32
|
-
- id: isort
|
|
33
|
-
args: ["--profile", "black"]
|
|
34
|
-
- repo: https://github.com/PyCQA/flake8
|
|
35
|
-
rev: 6.0.0
|
|
36
|
-
hooks:
|
|
37
|
-
- id: flake8
|
|
38
|
-
additional_dependencies:
|
|
39
|
-
- flake8-bugbear
|
|
40
|
-
- flake8-comprehensions
|
|
41
|
-
- flake8-tidy-imports
|
|
42
|
-
- flake8-typing-imports
|
|
43
|
-
- repo: https://github.com/mgedmin/check-manifest
|
|
44
|
-
rev: "0.49"
|
|
45
|
-
hooks:
|
|
46
|
-
- id: check-manifest
|
|
47
|
-
args: [--no-build-isolation]
|
|
48
|
-
additional_dependencies: ["Django>=2.2"]
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v4.4.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-added-large-files
|
|
6
|
+
- id: check-case-conflict
|
|
7
|
+
- id: check-json
|
|
8
|
+
- id: check-merge-conflict
|
|
9
|
+
- id: check-symlinks
|
|
10
|
+
- id: check-toml
|
|
11
|
+
- id: end-of-file-fixer
|
|
12
|
+
- id: trailing-whitespace
|
|
13
|
+
exclude: .bumpversion.cfg
|
|
14
|
+
- repo: https://github.com/asottile/pyupgrade
|
|
15
|
+
rev: v3.7.0
|
|
16
|
+
hooks:
|
|
17
|
+
- id: pyupgrade
|
|
18
|
+
args: [--py36-plus]
|
|
19
|
+
- repo: https://github.com/psf/black
|
|
20
|
+
rev: 23.3.0
|
|
21
|
+
hooks:
|
|
22
|
+
- id: black
|
|
23
|
+
- repo: https://github.com/asottile/blacken-docs
|
|
24
|
+
rev: 1.14.0
|
|
25
|
+
hooks:
|
|
26
|
+
- id: blacken-docs
|
|
27
|
+
additional_dependencies:
|
|
28
|
+
- black>=22.12.0
|
|
29
|
+
- repo: https://github.com/pycqa/isort
|
|
30
|
+
rev: 5.12.0
|
|
31
|
+
hooks:
|
|
32
|
+
- id: isort
|
|
33
|
+
args: ["--profile", "black"]
|
|
34
|
+
- repo: https://github.com/PyCQA/flake8
|
|
35
|
+
rev: 6.0.0
|
|
36
|
+
hooks:
|
|
37
|
+
- id: flake8
|
|
38
|
+
additional_dependencies:
|
|
39
|
+
- flake8-bugbear
|
|
40
|
+
- flake8-comprehensions
|
|
41
|
+
- flake8-tidy-imports
|
|
42
|
+
- flake8-typing-imports
|
|
43
|
+
- repo: https://github.com/mgedmin/check-manifest
|
|
44
|
+
rev: "0.49"
|
|
45
|
+
hooks:
|
|
46
|
+
- id: check-manifest
|
|
47
|
+
args: [--no-build-isolation]
|
|
48
|
+
additional_dependencies: ["Django>=2.2"]
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Contributing
|
|
2
|
-
|
|
3
|
-
See the [Contributing guide in the documentation](https://dlrsp.github.io/django-requests-api/community/contributing/).
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
See the [Contributing guide in the documentation](https://dlrsp.github.io/django-requests-api/community/contributing/).
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2010-present DLRSP (https://dlrsp.org) and other contributors.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2010-present DLRSP (https://dlrsp.org) and other contributors.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
include *.py
|
|
2
|
-
include *.rst
|
|
3
|
-
include *.md
|
|
4
|
-
include *.yaml
|
|
5
|
-
include *.yml
|
|
6
|
-
include *.cfg
|
|
7
|
-
include tox.ini
|
|
8
|
-
include LICENSE
|
|
9
|
-
|
|
10
|
-
recursive-include requirements *.in *.txt
|
|
11
|
-
recursive-exclude requirements *.py
|
|
12
|
-
recursive-include src *.py *.html *.css *.js *.po *.mo *.gif *.png *.json
|
|
13
|
-
recursive-include tests *.py
|
|
14
|
-
recursive-exclude docs *
|
|
1
|
+
include *.py
|
|
2
|
+
include *.rst
|
|
3
|
+
include *.md
|
|
4
|
+
include *.yaml
|
|
5
|
+
include *.yml
|
|
6
|
+
include *.cfg
|
|
7
|
+
include tox.ini
|
|
8
|
+
include LICENSE
|
|
9
|
+
|
|
10
|
+
recursive-include requirements *.in *.txt
|
|
11
|
+
recursive-exclude requirements *.py
|
|
12
|
+
recursive-include src *.py *.html *.css *.js *.po *.mo *.gif *.png *.json
|
|
13
|
+
recursive-include tests *.py
|
|
14
|
+
recursive-exclude docs *
|
|
@@ -1,96 +1,95 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: django-requests-api
|
|
3
|
-
Version: 0.2
|
|
4
|
-
Summary: Django application to provide simple and shared requests client.
|
|
5
|
-
Home-page: https://github.com/DLRSP/django-requests-api
|
|
6
|
-
Author: DLRSP
|
|
7
|
-
Author-email: dlrsp.dev@gmail.com
|
|
8
|
-
License: MIT License
|
|
9
|
-
Keywords: django,requests,API,privacy,cookie
|
|
10
|
-
Classifier: Development Status :: 4 - Beta
|
|
11
|
-
Classifier: Environment :: Web Environment
|
|
12
|
-
Classifier: Framework :: Django
|
|
13
|
-
Classifier: Framework :: Django :: 3.2
|
|
14
|
-
Classifier: Framework :: Django :: 4.
|
|
15
|
-
Classifier: Intended Audience :: Developers
|
|
16
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
-
Classifier: Operating System :: OS Independent
|
|
18
|
-
Classifier: Programming Language :: Python
|
|
19
|
-
Classifier: Programming Language :: Python :: 3
|
|
20
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.
|
|
25
|
-
Classifier:
|
|
26
|
-
Classifier:
|
|
27
|
-
Classifier: Topic :: Internet :: WWW/HTTP
|
|
28
|
-
Classifier: Topic :: Internet :: WWW/HTTP ::
|
|
29
|
-
Classifier: Topic ::
|
|
30
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Provides-Extra:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
[](https://pypi.python.org/pypi/django-requests-api)
|
|
38
|
+
|
|
39
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
40
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
41
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
42
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
43
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
44
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
45
|
+
|
|
46
|
+
## GitHub  
|
|
47
|
+
|
|
48
|
+
## Test [](https://codecov.io/github/DLRSP/django-requests-api?branch=master) [](https://results.pre-commit.ci/latest/github/DLRSP/django-requests-api/master) [](https://github.com/DLRSP/django-requests-api/actions/workflows/ci.yml)
|
|
49
|
+
|
|
50
|
+
## Check Demo Project
|
|
51
|
+
* Browser the demo app on-line on [Heroku](https://django-requests-api.herokuapp.com/)
|
|
52
|
+
* Check the demo repo on [GitHub](https://github.com/DLRSP/example/tree/django-requests-api)
|
|
53
|
+
|
|
54
|
+
## Requirements
|
|
55
|
+
- Python 3.8+ supported.
|
|
56
|
+
- Django 3.2+ supported.
|
|
57
|
+
|
|
58
|
+
## Setup
|
|
59
|
+
1. Install from **pip**:
|
|
60
|
+
```shell
|
|
61
|
+
pip install django-requests-api
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
2. Modify `settings.py` by adding the app to `INSTALLED_APPS`:
|
|
65
|
+
```python
|
|
66
|
+
INSTALLED_APPS = (
|
|
67
|
+
# ...
|
|
68
|
+
"requests_api",
|
|
69
|
+
# ...
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Usage
|
|
74
|
+
|
|
75
|
+
```shell
|
|
76
|
+
from requests_api import RequestsApi
|
|
77
|
+
|
|
78
|
+
client = RequestsApi("https://api.publicapis.org")
|
|
79
|
+
r = client.get("/entries")
|
|
80
|
+
print(r.json())
|
|
81
|
+
|
|
82
|
+
github = RequestsApi("https://api.github.com", headers={"Authorization": "token abcdef"})
|
|
83
|
+
r = github.get("/user", headers={"Accept": "application/json"})
|
|
84
|
+
print(r.text)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Run Example Project
|
|
88
|
+
|
|
89
|
+
```shell
|
|
90
|
+
git clone --depth=50 --branch=django-requests-api https://github.com/DLRSP/example.git DLRSP/example
|
|
91
|
+
cd DLRSP/example
|
|
92
|
+
python manage.py runserver
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Now browser the app @ http://127.0.0.1:8000
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
# django-requests-api [](https://pypi.python.org/pypi/django-requests-api)
|
|
2
|
-
|
|
3
|
-
[](https://pypi.python.org/pypi/django-requests-api)
|
|
4
|
-
[](https://pypi.python.org/pypi/django-requests-api)
|
|
5
|
-
[](https://pypi.python.org/pypi/django-requests-api)
|
|
6
|
-
[](https://pypi.python.org/pypi/django-requests-api)
|
|
7
|
-
[](https://pypi.python.org/pypi/django-requests-api)
|
|
8
|
-
[](https://pypi.python.org/pypi/django-requests-api)
|
|
9
|
-
|
|
10
|
-
## GitHub  
|
|
11
|
-
|
|
12
|
-
## Test [](https://codecov.io/github/DLRSP/django-requests-api?branch=master) [](https://results.pre-commit.ci/latest/github/DLRSP/django-requests-api/master) [](https://github.com/DLRSP/django-requests-api/actions/workflows/ci.yml)
|
|
13
|
-
|
|
14
|
-
## Check Demo Project
|
|
15
|
-
* Browser the demo app on-line on [Heroku](https://django-requests-api.herokuapp.com/)
|
|
16
|
-
* Check the demo repo on [GitHub](https://github.com/DLRSP/example/tree/django-requests-api)
|
|
17
|
-
|
|
18
|
-
## Requirements
|
|
19
|
-
- Python 3.
|
|
20
|
-
- Django 3.2
|
|
21
|
-
|
|
22
|
-
## Setup
|
|
23
|
-
1. Install from **pip**:
|
|
24
|
-
```shell
|
|
25
|
-
pip install django-requests-api
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
2. Modify `settings.py` by adding the app to `INSTALLED_APPS`:
|
|
29
|
-
```python
|
|
30
|
-
INSTALLED_APPS = (
|
|
31
|
-
# ...
|
|
32
|
-
"requests_api",
|
|
33
|
-
# ...
|
|
34
|
-
)
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Usage
|
|
38
|
-
|
|
39
|
-
```shell
|
|
40
|
-
from requests_api import RequestsApi
|
|
41
|
-
|
|
42
|
-
client = RequestsApi("https://api.publicapis.org")
|
|
43
|
-
r = client.get("/entries")
|
|
44
|
-
print(r.json())
|
|
45
|
-
|
|
46
|
-
github = RequestsApi("https://api.github.com", headers={"Authorization": "token abcdef"})
|
|
47
|
-
r = github.get("/user", headers={"Accept": "application/json"})
|
|
48
|
-
print(r.text)
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Run Example Project
|
|
52
|
-
|
|
53
|
-
```shell
|
|
54
|
-
git clone --depth=50 --branch=django-requests-api https://github.com/DLRSP/example.git DLRSP/example
|
|
55
|
-
cd DLRSP/example
|
|
56
|
-
python manage.py runserver
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Now browser the app @ http://127.0.0.1:8000
|
|
1
|
+
# django-requests-api [](https://pypi.python.org/pypi/django-requests-api)
|
|
2
|
+
|
|
3
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
4
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
5
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
6
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
7
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
8
|
+
[](https://pypi.python.org/pypi/django-requests-api)
|
|
9
|
+
|
|
10
|
+
## GitHub  
|
|
11
|
+
|
|
12
|
+
## Test [](https://codecov.io/github/DLRSP/django-requests-api?branch=master) [](https://results.pre-commit.ci/latest/github/DLRSP/django-requests-api/master) [](https://github.com/DLRSP/django-requests-api/actions/workflows/ci.yml)
|
|
13
|
+
|
|
14
|
+
## Check Demo Project
|
|
15
|
+
* Browser the demo app on-line on [Heroku](https://django-requests-api.herokuapp.com/)
|
|
16
|
+
* Check the demo repo on [GitHub](https://github.com/DLRSP/example/tree/django-requests-api)
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
- Python 3.8+ supported.
|
|
20
|
+
- Django 3.2+ supported.
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
1. Install from **pip**:
|
|
24
|
+
```shell
|
|
25
|
+
pip install django-requests-api
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. Modify `settings.py` by adding the app to `INSTALLED_APPS`:
|
|
29
|
+
```python
|
|
30
|
+
INSTALLED_APPS = (
|
|
31
|
+
# ...
|
|
32
|
+
"requests_api",
|
|
33
|
+
# ...
|
|
34
|
+
)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```shell
|
|
40
|
+
from requests_api import RequestsApi
|
|
41
|
+
|
|
42
|
+
client = RequestsApi("https://api.publicapis.org")
|
|
43
|
+
r = client.get("/entries")
|
|
44
|
+
print(r.json())
|
|
45
|
+
|
|
46
|
+
github = RequestsApi("https://api.github.com", headers={"Authorization": "token abcdef"})
|
|
47
|
+
r = github.get("/user", headers={"Accept": "application/json"})
|
|
48
|
+
print(r.text)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Run Example Project
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
git clone --depth=50 --branch=django-requests-api https://github.com/DLRSP/example.git DLRSP/example
|
|
55
|
+
cd DLRSP/example
|
|
56
|
+
python manage.py runserver
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Now browser the app @ http://127.0.0.1:8000
|