Simple django app to expose system infos: libraries version, databae server infos...
Project description
django-sysinfo
Simple django app to expose system infos like libraries version, database server…
Rationale
In our environment we manage dozens of Django applications and sometimes we need to answer questions like:
which application is using this broken/outdated package ?
which application is using that database ?
scan all the installed sites, is tedious, we have a documentation site with all these infos, but we want to keep it always updated. Here where django-sysinfo comes to help.
It provides a simple view that returns a json response containing:
- environment:
installed modules and version
- project:
MEDIA_ROOT/STATIC_ROOT path and available disk space
django installed apps
process path
temp dir path
- databases:
ip
engine
version
mail server
- os:
name
- python:
version
executable path
- host:
cpu(s) number
free/total memory
NIC list and relative IP addresses
- extra:
<user defined functions>
You can add entries and/or remove what can be dangerous in your enviroment. The url is protected with Basic Authentication without install RemoteUserBackend.
- Allowed user can be restricted using settings.SYSINFO_USERS
if not exists any superuser can use the endpoint:
settings.SYSINFO_USERS = ['username',]
Quickstart
Install django-sysinfo:
pip install django-sysinfo
put it in your INSTALLED_APPS:
INSTALLED_APPS=[... 'django_sysinfo' ]
add relevant entries in your url.conf:
urlpatterns = ( .... url(r'', include(django_sysinfo.urls)), )
or customize them:
from django_sysinfo.views import http_basic_login, sysinfo urlpatterns = ( url('sys/info/$', http_basic_login(sysinfo), name='sys-info'), url('sys/version/(?P<name>.*)/$', version, name='sys-version') )
Known issues and limitations
There are some limitations in the metrics returned by sysinfo, anyway this package is not intended to be used as host/resources monitoring tool.
Disk space returns device info, any soft limits are ignored
Memory can be wrong in some virtual environments
Links
Stable |
|||||
Development |
|||||
Project home page: |
|||||
Issue tracker: |
|||||
Download: |
|||||
Documentation: |
History
1.1 14 Jul 2017
Django 1.11 compatibility
handle broken database connections
add new mail server informations
new ‘checks’ API
BACKWARD INCONPATIBLE: new config format
1.0 (15 Mar 2017)
fixes error in json serialization
BACKWARD INCOMPATIBLE: by default all the sections are disabled
allow both string and callable in extra section
added new configuration parameters
new management command
0.3 (27 Mar 2016)
dropped support Django<1.6
add settings.SYSINFO_USERS to manage access
default Basic Authentication protected urls
removed ‘sys’ prefix from default urlpatterns
new ‘echo’ endpoint
0.2 (13 Feb 2016)
add some infos
output sorted to improve readibility
add ability to filter sections (?s=os,python)
add CACHES infos
removed command line utility
0.1.1 (20 Jan 2016)
improved coverage
fixes typos in copyright
0.1.0 (15 Jan 2015)
First release on PyPI.
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
Built Distribution
File details
Details for the file django-sysinfo-1.1.tar.gz
.
File metadata
- Download URL: django-sysinfo-1.1.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bb52d977d41d7b203f4ac481784363ea88e3b3d862d30c2ca06e5675887b781 |
|
MD5 | 56e849e8ffa46f43bd216b3e30f5b1d2 |
|
BLAKE2b-256 | 1e99cf63bb8bffeb9c5d2af222a31775e137fe7a1c7da7c1b7a6377f26107951 |
File details
Details for the file django_sysinfo-1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_sysinfo-1.1-py2.py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec4363721a4ff191eed597a4e47322222bfdae12de66c6c28965a15cbac17b05 |
|
MD5 | 9d3b2378ae24894a6174e1ddd56f2a09 |
|
BLAKE2b-256 | 7ce8e3fc90f509449f5bca21b606d5afb9c2742f1cebb0e8994b4bf162f33c09 |