Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-logui

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-logui

Flexible, fast and productive UI for logging in Django

  • 0.1.2
  • Source
  • PyPI
  • Socket score

Maintainers
1

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}'
    }
    

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc