Skip to main content

Library for logging changes of each model

Project description

Model logs is a Django app for storing changes of yours objects

Quick start

  1. Add “model_log” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'model_log',
    ]
  2. Run python manage.py migrate to create the “model_logs” models.

  3. For adding or excluding the models you want to log, in the settings.py:

    MODELS_FOR_LOGGING = (
        'app.ClassName',    # logging only for this model
        'another_app'     # logging of all models in this app
    )
    
    MODELS_FOR_EXCLUDE = (
        'app.ClassName',    # excluding from logging only for this model
    )
  4. To override Django’s default view to show the history of a log, use LogModelAdmin instead of ModelAdmin:

    class ExampleAdmin(LogModelAdmin):
        pass

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-model-logs-0.1.15.tar.gz (8.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page