Common utils for Django-based projects.
Collection of various utils for Django-based projects.
This is code that we’re using in our projects at Thorgate and we’re hoping you’ll find some of it useful as well.
- Free software: ISC license
- Documentation: https://tg-utils.readthedocs.org.
- Model utils, e.g. timestamped and closable models, QuerySets that send out a signal when objects are modified.
- Templated email sending.
- Profiling utilities.
- Unique filename generation for uploads.
- Using hashids for models (instead of exposing primary keys).
- System checks for email and Sentry configuration.
- Mixin for easier implementation of ordering in Django’s generic ListView.
- Mixin for making admin view read-only.
- Decorator for annotating admin methods.
- JS/CSS compressors for Django Compressor.
- Health-check endpoints (with and without token authentication)
- Add ReadOnlyAdminMixin for Django admin views
- Add a decorator for annotating admin methods (annotate_admin_method)
- Make celery beat health-check error message more comprehensive
- Bugfix: Prevent celery beat health-check from false-failing initially. Thanks @iharthi
- Add extra require for hashids.
- Fix usage of deprecated from hashids.
- Updated dependencies to support Django LTS correctly.
- Added health-check for celery and celery beat. Thanks @iharthi
- Added health-check helpers. Thanks @iharthi
- Added locking decorator. Thanks @iharthi
- Supported Django and Python versions are listed below
|Django version||Python versions|
|Django 1.8||3.4, 3.5, 3.6|
|Django 1.11||3.4, 3.5, 3.6|
|Django 2.0||3.4, 3.5, 3.6, 3.7|
|Django 2.1||3.5, 3.6, 3.7|
- Supported Django versions are now 1.8, 1.11, and 2.0. ClosableModel.created_by and closed_by now have on_delete=models.SET_NULL attribute.
- Supported Python versions are now 3.4, 3.5, and 3.6.
- Rename tg_utils.yuglify module to tg_utils.compressor_filters and added new filters for using UglifyJS 2 and clean-css.
- Added docs for tg_utils.compressor_filters module.
- First release on PyPI.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size tg_utils-0.7.4-py2.py3-none-any.whl (22.8 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View hashes|
|Filename, size tg-utils-0.7.4.tar.gz (24.9 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for tg_utils-0.7.4-py2.py3-none-any.whl