A Django application that allows you to store detailed data in the change log and display the detailed information in object's history view.
Project description
django-data-history
A Django application that allows you to store detailed data in the change log and display the detailed information in object's history view.
Install
pip install django-data-history
Usage
## add app: django_middleware_global_request
## add app: django_static_jquery_ui
## add app: django_data_history
## put django_data_history before django.contrib.admin
INSTALLED_APPS = [
...
"django_middleware_global_request",
"django_static_jquery_ui",
'django_data_history',
...
'django.contrib.admin',
...
]
## add middleware: django_middleware_global_request.middleware.GlobalRequestMiddleware
## add middleware: django_data_history.middlewares.HttpXRequestIdMiddleware
MIDDLEWARE = [
...
"django_middleware_global_request.middleware.GlobalRequestMiddleware",
"django_data_history.middlewares.HttpXRequestIdMiddleware",
...
]
## add X-Request-Id in nginx config file
## set_proxy_header X-Request-Id $reqid
## Change REQUEST_ID_HEADER to match the request header
REQUEST_ID_HEADER = "HTTP_X_REQUEST_ID"
## auto generate request id if the header is not set by nginx
AUTO_GENERATE_REQUEST_ID = True
# default to False, so you must set it to True to enable all models injection.
SAVE_DATA_HISTORIES_FOR_ALL = True
# if SAVE_DATA_HISTORIES_FOR_ALL==False, then only these models will be injected.
# default to empty.
SAVE_DATA_HISTORIES_FOR = [
"your_app1.model_name1"
]
# if SAVE_DATA_HISTORIES_FOR_ALL==True, these models will NOT be injected.
# default to:
# [
# "sessions.session",
# "contenttypes.contenttype",
# "admin.logentry",
# "auth.permission",
# ]
DO_NOT_SAVE_DATA_HISTORIES_FOR = [
"your_app2.model_name2",
]
Instance's history view
Releases
v0.1.0
- First release.
v0.1.1
- Fix ugettext_lazy problem.
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
django-data-history-0.1.1.tar.gz
(12.6 kB
view details)
Built Distribution
File details
Details for the file django-data-history-0.1.1.tar.gz
.
File metadata
- Download URL: django-data-history-0.1.1.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f01db3aa8ac5d7b2a5b1a88474e709b314239da4c9926ba114508a8ac707b202 |
|
MD5 | c72c99e70504582fb31fff109e367c5e |
|
BLAKE2b-256 | 49e8bdf08e2dd59dedc9782eedd0bd111a44c60543a52bff84021df66ccfdb36 |
File details
Details for the file django_data_history-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: django_data_history-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7f74dc4e263135df7db869b798d1128c77d841a4a82e51c362a6d5db626d285 |
|
MD5 | 3e62073d95163bf193a9504e0b6989eb |
|
BLAKE2b-256 | e19e9fa28ab1427a550bb4c6d54e67a65efe1d60c1512dc5fd1218a9864c6438 |