Django mock rest
Simple way to create static mock data at rest api endpoints in the Django admin.
If you’re designing a rest api client, and want to create a simple mock server for testing, then this app lets you do that using the Django admin.
Install
Install using
pip install django-mock-rest
Add django_mock_rest to installed apps in settings.py:
INSTALLED_APPS = [
...
'django_mock_rest',
...
]
By default the mock service is available only in DEBUG mode. You can override this with DJANGO_MOCK_REST = True or False.
Add the root url to url.py:
urlpatterns = [
...
url(r'^api-mock/', include('django_mock_rest.urls')),
...
]
How to use
In the Django admin, you can create endpoints:
After that, you can do http(s) request to the endpoints you defined:
$ curl -X GET http://127.0.0.1:8000/api-mock/post/1/
{
"post": "Hello world"
}
You can also see an overview of all the mock endpoints (if logged in) by visiting ~, i.e. http://127.0.0.1:8000/api-mock/~.
Metadata
Release files for django-mock-rest 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-mock-rest-1.3.tar.gz | 5.8 kB | Without provenance | Details for django-mock-rest-1.3.tar.gz |
Release files / django-mock-rest-1.3.tar.gz
| Download URL | django-mock-rest-1.3.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25fae5ea4eff1eaea3e2ffd2ad281950ae52feafcd3e2307efa986cf869ac7e2
|
|
BLAKE2b-256 checksum How to use checksums |
babbe7c50d33b9671b7d8af83cdfa751e0261a2bb77bd44319da6708bff20f04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/2.7
|
Security for django-mock-rest 1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.