django-retention-policy
Deletes Django database records according to a retention policy of your choice.
Installation
First of all you need your Django application setup with Celery. With both a worker process and a Celery beat process.
Then proceed to install the package.
pip install django-retention-policy
And setup the periodic Celery task, in your settings.py:
from datetime import timedelta
EIGHT_WEEKS_IN_SECS = 86400 * 7 * 8
CELERY_BEAT_SCHEDULE = {
'periodic-task_delete_expired_db_records': {
'task': 'django_retention_policy.task_delete_expired_db_records',
'schedule': timedelta(hours=12),
'kwargs': {
'app_name': 'django_app_name_here',
'model_name': 'YourDjangoModelNameHere',
'time_based_column_name': 'timestamp',
'data_retention_num_seconds': EIGHT_WEEKS_IN_SECS,
},
},
}
CELERY_IMPORTS = (
'django_retention_policy',
)
That's it. Start up your Celery worker, and Celery beat processes and the automatic deletion will take place according to your configuration.
Release History
0.1.1 (2022-08-10)
- Documentation fixes.
0.1.0 (2022-08-10)
- Initial release.
Metadata
Release files for django-retention-policy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_retention_policy-0.1.1.tar.gz | 10.7 kB | Without provenance | Details for django_retention_policy-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_retention_policy-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for django_retention_policy-0.1.1-py2.py3-none-any.whl |
Total release size: 17.6 kB
Release files / django_retention_policy-0.1.1.tar.gz
| Download URL | django_retention_policy-0.1.1.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22764abfe94462e655b5eeabdd281bdf57dd8dc8fb0d4d31a6f10149e6c4adc7
|
|
BLAKE2b-256 checksum How to use checksums |
3f8e1bcc059db63d09cbec3115787c1e8aab49f4a579105c6bc1f64a341e6f86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.10
|
Release files / django_retention_policy-0.1.1-py2.py3-none-any.whl
| Download URL | django_retention_policy-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
fad97384bd2f7fcf4e504cd5a5cfb6e4ba5b121cf6e75873cf42dbc0023a1feb
|
|
BLAKE2b-256 checksum How to use checksums |
717aacfc904168d054c1dd10276d4e17861e74dce3badb1516d445f2021516fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.10
|
Security for django-retention-policy 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.