Django reusable app for record request/response information to database for alert and audit.
pip install django-api-log
- add
django_api_log.apps.DjangoApiLogConfig
to INSTALLED_APPS. - add
django_api_log.middleware.ApiLogMiddleware
to MIDDLEWARE (MIDDLEWARE_CLASSES if you use django<1.10) - run
python manage.py migrate
- config urlpatterns
eg: add
url(r'^api-log', include(u'django_api_log.urls'), name='django_api_log')
to your root urlpatterns or other urlpatterns you like .
then, everything should be fine. :)
open your browser then visit YOUR_API_HOST/api-log (or use the path you use)