Skip to main content
https://img.shields.io/pypi/dm/django-actions-logger.svg https://img.shields.io/pypi/v/django-actions-logger.svg

A Django app that keeps a log of user actions or changes in objects You can log arbitrary action with user and optional info that goes with your action.

this code forked from django-auditlog and add my new ideas

Quick start

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

    INSTALLED_APPS = [
        ...
        'actionslog',
    ]
  2. Run python manage.py migrate to create models.

  3. Set AL_LOG_ACTION_CHOICES in project settings.py file if need customize:

    AL_LOG_ACTION_CHOICES = [
        (CREATE, _("create")),
        (SUCCESS, _("success")),
        (VIEW, _("view")),
        (UPDATE, _("update")),
        (DELETE, _("delete")),
        (ERROR, _("error")),
    ]

Usage

Simple:

status_msg = 'Reset password %s' % ('success' if success else 'error',)
la_kwargs = {
    'request': request,
    'instance': obj,
    'user': request.user,
    'action_info': {'info': status_msg},
}
LogAction.objects.create_log_action(**la_kwargs)

or

status_msg = 'Reset password %s' % ('success' if success else 'error',)
la_kwargs = {
    'request': request,
    'instance': obj,
    'user': request.user,
    'action': LogAction.SUCCESS if success else LogAction.ERROR,
    'changes': status_msg,
}
LogAction.objects.create_log_action(**la_kwargs)

Download files

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

Source Distribution

django-actions-logger-0.3.1.tar.gz (10.8 kB view details)

Uploaded Source

File details

Details for the file django-actions-logger-0.3.1.tar.gz.

File metadata

  • Download URL: django-actions-logger-0.3.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for django-actions-logger-0.3.1.tar.gz
Algorithm Hash digest
SHA256 25637387912881c047c0ca1345c38dd3198850e5708ec82adf8fdd702a69b63b
MD5 55dc760fe51d4b167216451815f45f7b
BLAKE2b-256 459c4137bde2f7a3bf5438d05dcfafd510ea41fe7f238595ceab019642f3f31c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 file

0.3.0

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.0

1 file

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