Allows download django log file via api
Project description
django-log-api
Allows download django log file via api
Requirements
- django >= 2.2
- djangorestframework >= 3.9.2
- tailhead
Installation
- Install package
pip install django-log-api
# or
poetry add django-log-api
- 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",)
- add to urls.py
path(r"logs/", include("log_api.urls")),
parameters:
- name: log file name
- tail: if null, download entire log file, others the tail lines number
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-log-api-0.1.3.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for django_log_api-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3869a91406c71d87cbbe4d87c239fc718e1ff125f26908549f85c0f8fe6d039c |
|
MD5 | d6abaf3793c2b8af0cd03cb52aa7bc78 |
|
BLAKE2b-256 | f22fa8e6adab41cd777fa8c8f6faa27dab4b4cf19d4af7c1cba18a19b3278fbf |