Releases: cuongnbms/django-request-logging
Releases · cuongnbms/django-request-logging
Release list
v1.4
What's new
- Test suite — added a self-contained runner (
runtests.py) andtests/covering the middleware,get_ip_client, and theremove_old_request_logcommand. Runs on in-memory SQLite with no extra dependencies. - Admin filters —
RequestLogAdminnow haslist_filter(method, response_code, request_at) and adate_hierarchyfor easier log browsing. - Docs — documented that
get_ip_clientrelies on spoofable client headers and must not be trusted for security decisions; added test-running instructions to the README.
Install: pip install git+https://github.com/cuongnb14/django-request-logging.git@v1.4#egg=django-request-logging
v1.3
Performance & maintenance
- DB indexes: added indexes on
request_at,client_ip,response_codeand default-request_atordering to speed up admin listing and log cleanup (migration0003). - Cleanup command:
remove_old_request_lognow deletes in batches to avoid loading huge querysets into memory, validates thekeepunit (d/m), and logs the number of rows removed. - Middleware: store GET params as a plain dict (preserving multi-value params), harden
request.useraccess when auth middleware is absent, and remove dead code. - Admin: disable full result count on the list view to avoid expensive
COUNT(*)on large tables.
Packaging
- Migrated from
setup.pytopyproject.toml(PEP 621), declaring theDjango>=4.0dependency andrequires-python>=3.8.
Upgrade note: run python manage.py migrate request_logging to create the new indexes.