Skip to main content

django-log-api

Allows download django log file via api

Requirements

  • django >= 2.2
  • djangorestframework >= 3.9.2
  • tailhead

Installation

  1. Install package
pip install django-log-api

# or
poetry add django-log-api
  1. Add to the INSTALLED_APPS

settings.py

INSTALLED_APPS = [
    ...,
    "log_api",
]

# log dir path, use Path(), default: BASE_DIR / logs
LOG_API_DIR_PATH = BASE_DIR / "logs"
# log file name, default: 'django.log'
LOG_API_DEFAULT_FILE = "django.log"
# log tail numbers, default: 1000
LOG_API_MAX_READ_LINES = 1000
# log api permission, use drf`s permission, default: AllowAny
LOG_API_PERMISSION_CLASSES = ("rest_framework.permissions.AllowAny",)
  1. add to urls.py
path(r"logs/", include("log_api.urls")),
  1. visit 'http://localhost:8000/logs/download/?name=django&tail=100'

parameters:

  • name: log file name
  • tail: if null, download entire log file, others the tail lines number

Metadata

Release files for django-log-api 0.1.3

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-log-api 0.1.3
File Size Uploaded
django-log-api-0.1.3.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-log-api 0.1.3
File Interpreter ABI Platform
django_log_api-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / django-log-api-0.1.3.tar.gz

Download URL django-log-api-0.1.3.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
670afbed5389f102f7c9f76888667f9c89de63f6c64206042c7761bff867ee98
BLAKE2b-256 checksum
How to use checksums
2cc83900d31ce0b81075297419b8f0764055239464e4a5e9bea7f8e415baf582
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.7 Darwin/21.5.0

Release files / django_log_api-0.1.3-py3-none-any.whl

Download URL django_log_api-0.1.3-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3869a91406c71d87cbbe4d87c239fc718e1ff125f26908549f85c0f8fe6d039c
BLAKE2b-256 checksum
How to use checksums
f22fa8e6adab41cd777fa8c8f6faa27dab4b4cf19d4af7c1cba18a19b3278fbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.7 Darwin/21.5.0

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

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