Skip to main content

Purge

Build Status Documentation Status PyPI Coverage Report

Documentation: https://django-purge.readthedocs.io

Source: https://github.com/gregschmit/django-purge

PyPI: https://pypi.org/project/django-purge/

Purge is a reusable Django app for regularly purging old database entries, like logs.

The Problem: Tables/models like sessions and logs can grow without limit.

The Solution: This app allows you to schedule database purging of old records. You can also make FilePurgers which can purge old files based on datestamps in the filename or timestamps in the meta-data (atime/mtime/ctime).

How to Use

$ pip install django-purge

Include purge in your INSTALLED_APPS. Then, create your database purgers or file purgers in the admin interface.

Then, either periodically call the purge management command (e.g., via a system cronjob), or install and configure django-cron (add purge.cron to your CRON_CLASSES in your settings.py). The builtin CronJob class is set to run every 4 hours. You can change this by altering your settings.py and adding PURGE_CRON_RUN_AT_TIMES to an array of times you want to run the job at (e.g., ['1:00'] to run at 1am).

Contributing

Email gschmi4@uic.edu if you want to contribute. You must only contribute code that you have authored or otherwise hold the copyright to, and you must make any contributions to this project available under the MIT license.

To collaborators: don’t push using the --force option.

Dev Quickstart

Purge comes with a settings.py file, technically making it a Django project as well as a Django app. First clone, the repository into a location of your choosing:

$ git clone https://github.com/gregschmit/django-purge

Then you can go into the django-purge directory and do the initial migrations and run the server (you may need to type python3 rather than python):

$ cd django-purge
$ python manage.py makemigrations
$ python manage.py migrate
$ python manage.py createsuperuser
...
$ python manage.py runserver

Then you can see the models at http://127.0.0.1:8000/admin.

Metadata

Release files for django-purge 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-purge 1.0.0
File Size Uploaded Provenance Actions
django-purge-1.0.0.tar.gz 7.8 kB Without provenance Details for django-purge-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-purge 1.0.0
File Interpreter ABI Platform Actions
django_purge-1.0.0-py3-none-any.whl Python 3 none any Details for django_purge-1.0.0-py3-none-any.whl

Total release size: 19.1 kB

Release files / django-purge-1.0.0.tar.gz

Download URL django-purge-1.0.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
315564992b81c369dcbdea5adcf529c005f7bab9fb44043869d8e1c8108602a8
BLAKE2b-256 checksum
How to use checksums
2cea1ac4614e9eee649054b3a149398991a88f88ec3755e761a98a18a9e955f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Release files / django_purge-1.0.0-py3-none-any.whl

Download URL django_purge-1.0.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5100d423c4e6935149c72533d9623a76a74f170e9b47732d0c446a7772bf982a
BLAKE2b-256 checksum
How to use checksums
1592f41de2f7d25536a4b82b8fba1bdbcfeb086b2ee3ab930c30df3e55ed35cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Security for django-purge 1.0.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page