Django Simple Log Viewer
Django Simple Log Viewer is a simple, intuitive web-based log viewer for Django applications. It automatically discovers, parses, and displays your application log files inside a clean Material Dashboard interface with search, sorting, filtering, and pagination.
Features
Zero-Fuss Integration: Discovers log files and formatters directly from your standard Django LOGGING configuration.
Modern Django & Python Support: Tested and fully compatible with Python 3.11+ and Django 4.2+ / 5.0+.
Universal Log Format Support: - Supports %-style (%(asctime)s), {-style ({asctime}), and $-style ($asctime) formatters. - Automatically parses bracketed timestamps ([%(asctime)s]), hyphen delimiters, colons, and padded levels (%(levelname)-8s). - Handles Django documentation’s recommended formats seamlessly (including {process:d}, {thread:d}).
Multiline Traceback Preservation: Multi-line error stack traces and exceptions are automatically attached to their corresponding log entries and rendered cleanly with preserved formatting.
Rotated Logs Support: Easily browse through rotated log archives (e.g. app.log.1, app.log.2) via the file switcher dropdown.
Pathlib & Relative Path Support: Works seamlessly with pathlib.Path objects (e.g., BASE_DIR / 'logs' / 'app.log') and relative paths.
DataTables Interactive UI: Instant client-side search, sorting, and pagination powered by DataTables.
Secure by Default: Restricted to users with Django is_superuser permissions.
Customizable Themes: Choose from multiple built-in color schemes (purple, azure, green, orange, danger).
Compatibility
Python: 3.11, 3.12, 3.13+
Django: 4.2 (LTS), 5.0, 5.1, 5.2+
Installation
Install via pip:
pip install django-simple-log-viewer
Quick Start
Add log_viewer to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [ ..., 'log_viewer', ]Add the log viewer to your project’s urls.py:
from django.urls import path, include urlpatterns = [ ..., path('log-viewer/', include('log_viewer.urls')), ]Configure a file-based handler in your LOGGING setting in settings.py (if you haven’t already):
from pathlib import Path BASE_DIR = Path(__file__).resolve().parent.parent LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}', 'style': '{', }, 'standard': { 'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s', }, }, 'handlers': { 'file': { 'level': 'DEBUG', 'class': 'logging.FileHandler', 'filename': BASE_DIR / 'app.log', 'formatter': 'standard', }, }, 'loggers': { '': { 'handlers': ['file'], 'level': 'INFO', 'propagate': True, }, }, }Note: For optimal column layout, it is recommended to place the ``message`` attribute last in your format string.
Log in as a superuser and visit /log-viewer/ in your browser.
Settings
The following optional settings can be added to your settings.py:
SITE_NAME
Change the application name displayed in the sidebar and navigation bar (default is 'LogViewer'):
SITE_NAME = 'My Awesome Project'
LOG_FILE_EXTENSION
If your log files use an extension other than .log, specify it here (make sure to include the leading dot):
LOG_FILE_EXTENSION = '.txt'
Theming
To change the sidebar color theme, override or extend log_viewer/log_home.html and specify a theme name in the theme block:
{% extends "log_viewer/log_home.html" %}
{% block theme %}azure{% endblock %}
Available theme options: purple (default), azure, green, orange, danger.
Running Tests
To run the test suite:
python runtests.py
License
Released under the MIT License.
Metadata
Release files for django-simple-log-viewer 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django_simple_log_viewer-1.2.0.tar.gz | 277.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_simple_log_viewer-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 560.4 kB
Release files / django_simple_log_viewer-1.2.0.tar.gz
| Download URL | django_simple_log_viewer-1.2.0.tar.gz |
|---|---|
| Size | 277.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c81205cb85d63ee32552e999127719001ac307f9c2d5f4e813bf8446b31e80c4
|
|
BLAKE2b-256 checksum How to use checksums |
f2f7ae4d7694a70112d5a8f3de723b9cf7d6034de9ff7184e3cf605bfa06b7ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13
|
Release files / django_simple_log_viewer-1.2.0-py3-none-any.whl
| Download URL | django_simple_log_viewer-1.2.0-py3-none-any.whl |
|---|---|
| Size | 283.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8289f3c72875c95dd329f571fcffc76ba6ac416dae40b2a29922f7b7b57578f
|
|
BLAKE2b-256 checksum How to use checksums |
a013787f00320bbca9636685cc34a104c11893f1dcd4a17b446b4b89960f42f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13
|
Security for django-simple-log-viewer 1.2.0
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.