Skip to main content

Kantan Log

https://travis-ci.org/mmiyajima2/django-kantanlog.svg?branch=master https://coveralls.io/repos/github/mmiyajima2/django-kantanlog/badge.svg?branch=master

Kantan log is a simple Django helper app. This app supports logging to Django Model’s created_by, updated_by. At http requests interception, too.

Installation

shell>pip install djangokantanlog

Usage

Installed apps:

INSTALLED_APPS = [
  ...
  'kantanlog.apps.KantanlogConfig',
]

Middleware:

MIDDLEWARE = [
  ...
  'kantanlog.middlewares.KantanlogMiddleware',
]

Settings

KLOG_TARGET_APP_LABELS

Default: ()

Target apps, settings as app-label:

KLOG_TARGET_APP_LABELS = (
  ...
  'myapp',
)

KLOG_BACKEND

Default: kantanlog.backends.KantanlogDefaultBackend

As interface, getting user.

e.g.

# at settings.py
KLOG_BACKEND = 'dotted.path.to.MyappBackend'

...

# -*- coding: utf8 -*-
from logging import getLogger
from kantanlog.backends import KantanlogDefaultBackend
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework_jwt.settings import api_settings


logger = getLogger(__name__)
payload_handler = api_settings.JWT_PAYLOAD_HANDLER
encode_handler = api_settings.JWT_ENCODE_HANDLER


class MyappBackend(KantanlogDefaultBackend):

    def __init__(self):
        super().__init__()

    def get_user(self, request):
        user = super().get_user(request)
        if user.is_authenticated:
            return user
        ja = JSONWebTokenAuthentication()
        if ja.get_jwt_value(request):
            user, jwt = ja.authenticate(request)
            return user
        return user

Metadata

Release files for djangokantanlog 0.0.4

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

Source distribution (sdist)

Source distribution for djangokantanlog 0.0.4
File Size Uploaded Provenance Actions
djangokantanlog-0.0.4.tar.gz 6.4 kB Without provenance Details for djangokantanlog-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for djangokantanlog 0.0.4
File Interpreter ABI Platform Actions
djangokantanlog-0.0.4-py3-none-any.whl Python 3 none any Details for djangokantanlog-0.0.4-py3-none-any.whl

Total release size: 15.5 kB

Release files / djangokantanlog-0.0.4.tar.gz

Download URL djangokantanlog-0.0.4.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9fe0bbd02b2c530144003f6d6ae33a62ce3f47a014a78c36358a6ca683db2dbd
BLAKE2b-256 checksum
How to use checksums
49ae2c89469059cde8b5ead2bf3a128e048d5a44d62c598eb434fca8600505fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

Release files / djangokantanlog-0.0.4-py3-none-any.whl

Download URL djangokantanlog-0.0.4-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1af9ba823d41da05b21f34bbd0012bdc365b832cb4feab543657e796bc7f1068
BLAKE2b-256 checksum
How to use checksums
c4318ace7bb1906aeaa18a57eca3b5994e7dd9d88393938dc632344d127b6de6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

Security for djangokantanlog 0.0.4

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