Django api manager and unifier
Project description
django-morest - make your api more rest
Need to install pycryptodome to be able to use EncryptedTextField
v0.0.1 - Basic functionality of api
Documentation
settings.py
INSTALLED_APPS = [
...
"morest",
...
]
MIDDLEWARE = [
"morest.middlewares.RequestIDMiddleware",
"morest.middlewares.ExceptionMiddleware",
...
]
REST_FRAMEWORK = {
'EXCEPTION_HANDLER': "morest.middlewares.DRFExceptionMiddleware",
}
usage
test view
from django.http import HttpRequest
from rest_framework.views import APIView
from morest.api import Response
class TestView(APIView):
def get(self, request: HttpRequest):
return Response({
"key": "value"
})
response
{
"data": {
"key": "value"
},
"status": "ok",
"status_code": 200,
"request_id": "4d06538d2d7b40db8e729757a363fe55",
"message": "OK"
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django_morest-0.1.3.tar.gz
(17.6 kB
view details)
File details
Details for the file django_morest-0.1.3.tar.gz.
File metadata
- Download URL: django_morest-0.1.3.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61acee7b010674ae4f837b8ad49ca8e61ef2971cc91c731e93d8dca572fab046
|
|
| MD5 |
cebdf00ee5cda484a37588bcea5e32d6
|
|
| BLAKE2b-256 |
0884d2a8cd8d370122077c283b8f19b3206eaa4239584b34820e33ddb2bb1615
|