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.2.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for djanticapi-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 943ae12ed8439b9fafad340d60e5b4c29459e55789fbee32a9524ad10b0bdb03 |
|
MD5 | f2be47aa959f3868b864e705b8edac67 |
|
BLAKE2b-256 | 0a00052a02cc147917a02db8a7f06c4817ccd5d522ac402b2243328808bfd910 |