Provides various utilities for working with Django and DRF:
- admin.py: Additional classes and mixins for Django admin.
- emails.py: Classes to easily send sync and async emails through Django.
- exceptions.py: Additional exceptions for DRF.
- files.py: Utilities for handling files with DRF.
- images.py: Utilities for handling images within Django.
- models.py: Additional classes and utilities for Django models.
- network.py: Network related utilities to handle requests.
- permissions.py: Additional permissions for DRF.
- serializers.py: Additional serializers and fields for DRF.
- test_runner.py: Custom test runners for Django.
- test_utils.py: Additional TestCase classes with new assertions and utilities.
- viewsets.py: Custom ViewSets for DRF.
The package is available on PyPi with the name django-utils-kit
.
Simply run:
pip install django-utils-kit
Here's a list of all available imports for this package:
from django_utils_kit.admin import ReadOnlyAdminMixin
from django_utils_kit.emails import Email
from django_utils_kit.exceptions import Conflict, FailedPrecondition
from django_utils_kit.files import download_file, download_files_as_zip
from django_utils_kit.images import (
downsize_and_save_image_from_path,
downsize_image,
image_to_base64,
)
from django_utils_kit.models import (
FileNameWithUUID,
ImprovedModel,
PreCleanedAbstractModel,
update_m2m,
update_model_instance,
)
from django_utils_kit.network import get_client_ip, get_server_domain
from django_utils_kit.permissions import BlockAll, IsNotAuthenticated
from django_utils_kit.serializers import ReadOnlyModelSerializer, ThumbnailField
from django_utils_kit.test_runners import TimedTestRunner
from django_utils_kit.test_utils import APITestCase, AssertionTestCase, ImprovedTestCase
from django_utils_kit.viewsets import ImprovedViewSet