Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/open-byte/djestful-framework
RESTFul Framework for Django , autogenerate documentation with OpenAPI
https://github.com/open-byte/djestful-framework
api django django-rest-framework generator-schema open-api open-source openapi pydantic python rest-framework swagger swagger-ui
Last synced: 5 days ago
JSON representation
RESTFul Framework for Django , autogenerate documentation with OpenAPI
- Host: GitHub
- URL: https://github.com/open-byte/djestful-framework
- Owner: open-byte
- License: mit
- Created: 2024-02-24T18:12:52.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-16T04:13:45.000Z (about 2 months ago)
- Last Synced: 2024-10-31T07:51:31.717Z (12 days ago)
- Topics: api, django, django-rest-framework, generator-schema, open-api, open-source, openapi, pydantic, python, rest-framework, swagger, swagger-ui
- Language: Python
- Homepage:
- Size: 68.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DjestFul Framework
DjestFul is a framework which has the advantage of documenting the endpoints (views) of Django applications.
It is inspired by FastAPI, Django Ninja, and Django Restframework.
The main goal of DjestFul is to provide a simple way to document the endpoints of Django applications with the style of Django and FastAPI or Django Ninja.
For example, the following code is a simple Django view:
```python
```python
from django.http import HttpResponse, JsonResponse
from djestful.views import APIView
from djestful.decorators import action
from django.http import HttpRequestclass TestView(APIView):
@action.post('/users/me', summary='This is a test post endpoint')
async def post_test_endpoint(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
return JsonResponse(
{
'message': 'This is a test POST endpoint',
'function': 'post_test_endpoint',
}
)@action.get('/users/me', summary='This is a test get endpoint')
async def get_test_endpoint(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
return JsonResponse(
{
'message': 'This is a test endpoint',
'function': 'get_test_endpoint',
}
)## urls.py
from django.urls import path
from djestful.routers import Router
from test_app.views import TestView, TestView2router = Router()
router.include('api', TestView, basename='test_view')urlpatterns = [
path('api/', include(router.urls)),
]```