Skip to main content

Flexible, fast and productive UI for logging in Django

Project description

Django LogUi

Sometimes I use this in different projects, so I decided to put it on pypi

Installation

pip install django-logui

Settings

  • Add the application to the project.

    INSTALLED_APPS = [
        #...
        'adjango',
        'logui',
    ]
    
  • In settings.py set the params

    # settings.py
    from os.path import join
    from logui.utils import check_loggers
    
    
    # LOGS_DIR will be scanned for .log files
    # Nearest folders are also scanned.
    # LOGS_DIR *required
    LOGS_DIR = join(BASE_DIR, 'logs')
    
    LOGGING = ... # ur logging
    # Console report about existing loggers
    check_loggers(LOGGING)
    

    Read more about adjango

  • Add routes

    Only is_staff have access.

    from django.urls import path, include
    # Not use django.conf.settings
    from logui.conf import LOGUI_URL_PREFIX
    
    urlpatterns = [
        ...
        path(LOGUI_URL_PREFIX, include('logui.routes.views')),
    ]
    
  • Open https://localhost:8000/logui/

    https://localhost:8000/settings.LOGUI_URL_PREFIX

  • Additional

    # only for request response middleware
    LOGUI_REQUEST_RESPONSE_LOGGER_NAME = 'global'
    MIDDLEWARE = [
      ...
      'adjango.middleware.IPAddressMiddleware',  # first IP middleware from adjango
      'logui.middleware.RequestResponseLoggerMiddleware',  # second logui middleware
      ...
    ]
    
    # not required
    LOGUI_URL_PREFIX = 'logui/'
    LOGUI_CONTROLLERS_SETTINGS = {
        'auth_required': True,
        'log_name': False,
        'not_auth_redirect': f'/admin/login/?next=/{LOGUI_URL_PREFIX}'
    }
    

Project details


Download files

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

Source Distribution

django_logui-0.1.2.tar.gz (92.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_logui-0.1.2-py3-none-any.whl (94.7 kB view details)

Uploaded Python 3

File details

Details for the file django_logui-0.1.2.tar.gz.

File metadata

  • Download URL: django_logui-0.1.2.tar.gz
  • Upload date:
  • Size: 92.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.6

File hashes

Hashes for django_logui-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a02b5728814b8a6acebb34e5df97e5b2013d4e7a3a52123c41d3a33ba23c2cd4
MD5 657b602509da6a6fb7b97d56977259ea
BLAKE2b-256 d76d8f3c4e3296687889c90d83e3662849fac141594edd06b2d0db7626c45cc6

See more details on using hashes here.

File details

Details for the file django_logui-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: django_logui-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 94.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.6

File hashes

Hashes for django_logui-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0f91702fbaf5c1e89d43df0727fa589f79dee6ba7b9bb5d853747fb01653d07
MD5 1960627404da4448872a10da582b1a91
BLAKE2b-256 b081c9db9cd95fde8aaeb2e94a32e16f8a38de87a38e77f71563055e90d07f5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page