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.3.tar.gz
(10.2 kB
view hashes)
Built Distribution
djanticapi-0.0.3-py3-none-any.whl
(14.1 kB
view hashes)
Close
Hashes for djanticapi-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec1060a1b490adba96360c4c4f819a71da9fce185b53e4608b68f0a72434f95a |
|
MD5 | b3d743d3bc685b247d837495b389aa34 |
|
BLAKE2b-256 | e55c7837b92d5d750c906ac71636fe9c887454fdb33899fccc25d0ea6a0daef1 |