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.
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.0.tar.gz
(12.5 kB
view hashes)
Built Distribution
Close
Hashes for django-data-history-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a80793f326e35baed89c229f6e512ff6ed2b9fada5ed2b3e26db6cf8aa438bfd |
|
MD5 | 7e2870b9fde07a7aaa8ab6b7b8ded338 |
|
BLAKE2b-256 | 3d1250663f18a4efbcc98f3cbfcd02d15fb0998caf96502eb418a23811767f5c |
Close
Hashes for django_data_history-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 144b2136bdcebda95e2925496db02f475991c24520e4485763ff6e8ebe8db1fa |
|
MD5 | b638779f0b79287942d12f732edd5594 |
|
BLAKE2b-256 | 6c7cf2fd116a4fd1a2861b8f3d961954451442ca8f1658445dea8ec7a42b03bf |