Fast to learn, fast to code, fast to run
Django Shinobi - Fast Django REST Framework
Django Shinobi is a web framework for building APIs with Django and Python 3.6+ type hints.
It's a fork of the fantastic Django Ninja library focused on community-desired features and fixes. Check out the list of differences if you're coming from Ninja, as well as the roadmap!
Key features:
- Easy: Designed to be easy to use and intuitive.
- FAST execution: Very high performance thanks to Pydantic and async support.
- Fast to code: Type hints and automatic docs lets you focus only on business logic.
- Standards-based: Based on the open standards for APIs: OpenAPI (previously known as Swagger) and JSON Schema.
- Django friendly: (obviously) has good integration with the Django core and ORM.
- Production ready: The original Ninja project is used by multiple companies on live projects.
Documentation: https://pmdevita.github.io/django-shinobi
Installation
In your Django project, add Django Shinobi.
pip install django-shinobi
or start a new project.
pip install django django-shinobi
django-admin startproject apidemo
Usage
In your Django project, next to urls.py, create a new file called api.py.
from ninja import NinjaAPI
api = NinjaAPI()
@api.get("/add")
def add(request, a: int, b: int):
return {"result": a + b}
Now go to urls.py and add the following:
...
from .api import api
urlpatterns = [
path("admin/", admin.site.urls),
path("api/", api.urls), # <---------- !
]
That's it !
Now you've just created an API that:
- receives an HTTP GET request at
/api/add - takes, validates and type-casts GET parameters
aandb - decodes the result to JSON
- generates an OpenAPI schema for defined operation
Interactive API docs
Run your Django project
python manage.py runsever
Now go to http://127.0.0.1:8000/api/docs
You will see the automatic interactive API documentation (provided by Swagger UI or Redoc):
What next?
- Read the full documentation here - https://pmdevita.github.io/django-shinobi
- To support this project, please give star it on Github.
- Share it via Twitter
- Share your feedback and discuss development on Discord https://discord.gg/ntFTXu7NNv
Metadata
Release files for django-shinobi 1.4.2
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_shinobi-1.4.2.tar.gz | 3.7 MB | Without provenance | Details for django_shinobi-1.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_shinobi-1.4.2-py3-none-any.whl | Python 3 | none | any | Details for django_shinobi-1.4.2-py3-none-any.whl |
Total release size: 6.2 MB
Release files / django_shinobi-1.4.2.tar.gz
| Download URL | django_shinobi-1.4.2.tar.gz |
|---|---|
| Size | 3.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a6299fc07bcf70e5c462028dc673876b53101d49d7cbf3e30e02274305a22c6
|
|
BLAKE2b-256 checksum How to use checksums |
7c9c7d2696117521875d95ab24a4e60408b4508a86f49b76947621cf61a52a2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
python-requests/2.31.0
|
Release files / django_shinobi-1.4.2-py3-none-any.whl
| Download URL | django_shinobi-1.4.2-py3-none-any.whl |
|---|---|
| Size | 2.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a5e6a8bbb7bd216d8047402ffbb1610792cc4d9830e1810ee456f6fe6309150
|
|
BLAKE2b-256 checksum How to use checksums |
2226e97c89d227069de3f027d95ba7f7726a86e54d23117c193aca0183f2ef5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
python-requests/2.31.0
|
Security for django-shinobi 1.4.2
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.