Pydantic data validation support for Django API View
Project description
Requirements
Python 3.6+
Djanticapi stands on the shoulders of giants:
Installation
$ pip install djanticapi
---> 100%
Example
Create it
- Create a file
api.py
with:
from django.http import HttpRequest
from djanticapi import BaseFormModel, BaseAPIView
class TestForm(BaseFormModel):
name: str
class TestView(BaseAPIView):
def post(self, request: HttpRequest):
form_data = TestForm.from_request(request=request)
return form_data
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
djanticapi-0.0.1.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for djanticapi-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cae09200de0b910d2fa753cf0ad9af05b251cad0f95a63e8265d808155a4c2a |
|
MD5 | 542b958c437e2b8e5b42bad90b75a83b |
|
BLAKE2b-256 | ad0629885c1ea36d920ee6023f4531f34f24c5ecbb2d17d3b126661ac2acde43 |