Metadata-Version: 2.4
Name: dza_rest_utils
Version: 0.1.0
Summary: A Django package for REST API utilities.
Home-page: https://github.com/baybk/test_package_app_in_django.git
Author: Bay Nguyen
Author-email: baybknguyen@gmail.com
License: MIT
Classifier: Framework :: Django
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/markdown
Requires-Dist: django<5.0,>=4.2
Requires-Dist: djangorestframework>=3.16.0
Requires-Dist: drf-spectacular>=0.28.0
Requires-Dist: djangorestframework-simplejwt>=5.5.0
Requires-Dist: django-ipware>=7.0.1
Requires-Dist: django-filter>=25.1
Requires-Dist: requests[security]>=2.32.4
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: summary

# Overall

## Requirements

1. packages:
```
djangorestframework==3.16.0
drf-spectacular==0.28.0
djangorestframework-simplejwt==5.5.0
django-ipware==7.0.1
django-filter==25.1
```

## Usage:
Global exception handler for DRF. Handle every exception from Views.
Config in settings.py:
```
REST_FRAMEWORK = {
    'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework_simplejwt.authentication.JWTAuthentication',
    ),
    'EXCEPTION_HANDLER': 'dza_rest_utils.exceptions.custom_exception_handler',
    'DEFAULT_THROTTLE_CACHE': 'throttle_redis',
}
SIMPLE_JWT = {
    'ACCESS_TOKEN_LIFETIME': timedelta(hours=1),
    'REFRESH_TOKEN_LIFETIME': timedelta(days=3),
}
SPECTACULAR_SETTINGS = {}
```
