A Django Management Command to rename existing Django Applications.
Project description
django-retention-policy
Deletes Django database records according to a retention policy of your choice.
Installation
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.0 (2022-08-10)
- Initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django_retention_policy-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f327237d0f1565c593243a6a5aa9a59e2b82582dd229fa274e00072e073d2861 |
|
MD5 | a5f259fc4bbaa2e43719e42db7ce4d27 |
|
BLAKE2b-256 | a6ad99c725ed1348bf00ca34adefbd459fa4261a90bb8af469bb34c794775e1b |
Close
Hashes for django_retention_policy-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60b386a7a327cc2176e8d02b742c9380182bad049f989b91173f848cfc112ceb |
|
MD5 | 482435fda58fa7cd7111f121e98af688 |
|
BLAKE2b-256 | ecfce7a43eeff34941f4730f7624d33bb8bfd3d8d033259261d9893f8587af85 |