Based on django-profile-middleware.
this is a package that can profile your requests and functions/lines ,, created on top of cProfile.
Compatible with Django 1.11 and later
Python 3.x
Add "django_sprofile" to your INSTALLED_APPS setting like this:
- INSTALLED_APPS = [
... 'django_sprofile',
]
Add "django_sprofile.middleware.sProfilerMiddleware" to your MIDDLEWARE setting like this:
- MIDDLEWARE = [
... 'django_sprofile.middleware.sProfilerMiddleware',
]
Set sProfile Config(PROFILER) to your setting:
- PROFILER = {
'enable': True, 'sort': 'time', 'count': None , 'output': ['console','file'], 'file_location': 'profiling_results.txt'
}
- better logfile
- dashboard
- testing with django 2.2