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 details)
Built Distribution
File details
Details for the file djanticapi-0.0.6.tar.gz
.
File metadata
- Download URL: djanticapi-0.0.6.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92c94cb3078694f05ef0c2d746368824f28d32f6eca3565a9c65deef540dbadb |
|
MD5 | 233cfef89f0fdac6ba6147a40ccb0191 |
|
BLAKE2b-256 | 1dfa227e37a746d6acd76f8a0eeef2d3c03c72c820d4a242791ec389877b8c86 |
File details
Details for the file djanticapi-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: djanticapi-0.0.6-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20eac2cbcc624d69427eb0e21f475d05d14cf7bbb4b151317a63dc34fdb2cbf6 |
|
MD5 | 36ce4c414c6400d433e211e52d24b31f |
|
BLAKE2b-256 | dd8109921baca2119aae70b2c7a157c0f1a831d70b2043dee423444acbf13d3d |