Exceptions for Gizwits PaaS
Project description
It's Exception lib for Gizwits PaaS Usage.
How to use
install
pip install giz-exceptions
config in settings.py
base on Django REST Framework
REST_FRAMEWORK = {
'EXCEPTION_HANDLER': 'giz_exceptions.handler.custom_handler'
}
usage
from rest_framework.views import APIView
from giz_exceptions.paas import exceptions
class MyView(APIView):
def get(self, request, *args, **kwargs):
...
if not self.request.condition:
raise exceptions.ProductKeyInvalid
# or with detail message
# raise exceptions.ProductKeyInvalid('This required product key')
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
giz_exceptions-0.0.7.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for giz_exceptions-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd6e7a42d6fec6da02c9dff8418bcd62e75d9760dc923509726edacf0a9eb12d |
|
MD5 | 998f3fa6bc0dded1765ca2d206568930 |
|
BLAKE2b-256 | ec1a00eec0440d0d6e8a2b5ec5a2abea8c8ab7694c8a91913e97788be330a396 |