# Django LogUi
> Sometimes I use this in different projects, so I decided to put it on pypi
## Installation
```bash
pip install django-logui
```
## Settings
* ### Add the application to the project.
```python
INSTALLED_APPS = [
#...
'adjango',
'logui',
]
```
* ### In `settings.py` set the params
```python
# 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](https://github.com/Artasov/adjango)
* ### Add routes
Only `is_staff` have access.
```python
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
```python
# 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}'
}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Artasov/django-logui",
"name": "django-logui",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "django-logui django utils funcs features logs logging logger",
"author": "xlartas",
"author_email": "ivanhvalevskey@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d7/6d/8f3c4e3296687889c90d83e3662849fac141594edd06b2d0db7626c45cc6/django_logui-0.1.2.tar.gz",
"platform": null,
"description": "# Django LogUi \r\n\r\n> Sometimes I use this in different projects, so I decided to put it on pypi\r\n\r\n## Installation\r\n```bash\r\npip install django-logui\r\n```\r\n\r\n## Settings\r\n\r\n* ### Add the application to the project.\r\n ```python\r\n INSTALLED_APPS = [\r\n #...\r\n 'adjango',\r\n 'logui',\r\n ]\r\n ```\r\n* ### In `settings.py` set the params\r\n ```python\r\n # settings.py\r\n from os.path import join\r\n from logui.utils import check_loggers\r\n \r\n \r\n # LOGS_DIR will be scanned for .log files\r\n # Nearest folders are also scanned.\r\n # LOGS_DIR *required\r\n LOGS_DIR = join(BASE_DIR, 'logs')\r\n\r\n LOGGING = ... # ur logging\r\n # Console report about existing loggers\r\n check_loggers(LOGGING)\r\n ```\r\n #### Read more about [adjango](https://github.com/Artasov/adjango)\r\n* ### Add routes\r\n\r\n Only `is_staff` have access.\r\n ```python\r\n from django.urls import path, include\r\n # Not use django.conf.settings\r\n from logui.conf import LOGUI_URL_PREFIX\r\n\r\n urlpatterns = [\r\n ...\r\n path(LOGUI_URL_PREFIX, include('logui.routes.views')),\r\n ]\r\n ```\r\n* ### Open https://localhost:8000/logui/\r\n `https:`//`localhost:8000`/`settings.LOGUI_URL_PREFIX`\r\n\r\n* ### Additional\r\n ```python\r\n # only for request response middleware\r\n LOGUI_REQUEST_RESPONSE_LOGGER_NAME = 'global'\r\n MIDDLEWARE = [\r\n ...\r\n 'adjango.middleware.IPAddressMiddleware', # first IP middleware from adjango\r\n 'logui.middleware.RequestResponseLoggerMiddleware', # second logui middleware\r\n ...\r\n ]\r\n \r\n # not required\r\n LOGUI_URL_PREFIX = 'logui/'\r\n LOGUI_CONTROLLERS_SETTINGS = {\r\n 'auth_required': True,\r\n 'log_name': False,\r\n 'not_auth_redirect': f'/admin/login/?next=/{LOGUI_URL_PREFIX}'\r\n }\r\n ```\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Flexible, fast and productive UI for logging in Django",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/Artasov/django-logui",
"Source": "https://github.com/Artasov/django-logui",
"Tracker": "https://github.com/Artasov/django-logui/issues"
},
"split_keywords": [
"django-logui",
"django",
"utils",
"funcs",
"features",
"logs",
"logging",
"logger"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b081c9db9cd95fde8aaeb2e94a32e16f8a38de87a38e77f71563055e90d07f5b",
"md5": "1960627404da4448872a10da582b1a91",
"sha256": "b0f91702fbaf5c1e89d43df0727fa589f79dee6ba7b9bb5d853747fb01653d07"
},
"downloads": -1,
"filename": "django_logui-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1960627404da4448872a10da582b1a91",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 94686,
"upload_time": "2024-12-12T03:11:47",
"upload_time_iso_8601": "2024-12-12T03:11:47.558374Z",
"url": "https://files.pythonhosted.org/packages/b0/81/c9db9cd95fde8aaeb2e94a32e16f8a38de87a38e77f71563055e90d07f5b/django_logui-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d76d8f3c4e3296687889c90d83e3662849fac141594edd06b2d0db7626c45cc6",
"md5": "657b602509da6a6fb7b97d56977259ea",
"sha256": "a02b5728814b8a6acebb34e5df97e5b2013d4e7a3a52123c41d3a33ba23c2cd4"
},
"downloads": -1,
"filename": "django_logui-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "657b602509da6a6fb7b97d56977259ea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 92152,
"upload_time": "2024-12-12T03:11:50",
"upload_time_iso_8601": "2024-12-12T03:11:50.301761Z",
"url": "https://files.pythonhosted.org/packages/d7/6d/8f3c4e3296687889c90d83e3662849fac141594edd06b2d0db7626c45cc6/django_logui-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-12 03:11:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Artasov",
"github_project": "django-logui",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "django-logui"
}