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.
v0.1.2
- Add save_data_histories_for_fk_instance to fix inline edit history missing 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.2.tar.gz
(13.0 kB
view details)
Built Distribution
File details
Details for the file django-data-history-0.1.2.tar.gz
.
File metadata
- Download URL: django-data-history-0.1.2.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 450afa3a633d9abe57c157c69ef2e4a401e6c95ce06437238ff80aec42968d8b |
|
MD5 | 5d7526c49696717497a8423ac53961ce |
|
BLAKE2b-256 | cbf0d3c7fe84c8d87497e3941649d9897f872b95ac8cad357017d1068e2f4294 |
File details
Details for the file django_data_history-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: django_data_history-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4997a595d67d8d596bd3004ea72753ed75151c0bd3b47663ade8f7ef357f0ff3 |
|
MD5 | 567ea054b5bbc60e07361d31d0813cac |
|
BLAKE2b-256 | c9c800f1a7f45cf35fae3c8d456b8cc1a9ad7df211ff86a947a87593acd4568c |