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.6.tar.gz
(10.4 kB
view hashes)
Built Distribution
djanticapi-0.0.6-py3-none-any.whl
(14.3 kB
view hashes)
Close
Hashes for djanticapi-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20eac2cbcc624d69427eb0e21f475d05d14cf7bbb4b151317a63dc34fdb2cbf6 |
|
MD5 | 36ce4c414c6400d433e211e52d24b31f |
|
BLAKE2b-256 | dd8109921baca2119aae70b2c7a157c0f1a831d70b2043dee423444acbf13d3d |