Django simple profiler it is a useful tool for Django framework that allows you to profile your views.
Project description
Django simple profiler
Django simple profiler it is a useful tool for Django framework that allows you to profiling your views.
Example of use:
- decorate your views
- use as context manager
Requires DEBUG=True in settings.py (!)
https://github.com/Sobolev5/django-simple-profiler
How to install it
To install run:
pip install django-simple-profiler
example.py
from django.http import HttpResponse
from django_simple_profiler import django_profiler # as decorator
from django_simple_profiler import DjangoProfiler # as context manager
@django_profiler
def get_countries(request):
for country in Country.objects.all():
print(country)
return HttpResponse("OK")
def get_countries(request):
with DjangoProfiler() as dp:
for country in Country.objects.all():
print(country)
with DjangoProfiler(label="ActiveCountries") as dp:
for country in Country.objects.filter(active=True):
print(country)
return HttpResponse("OK")
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for django_simple_profiler-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46b59081ab3a555d30970dad809472030e065429a61a57e62a96ef4a05930fa8 |
|
MD5 | 856f2cf2bb50409d66047ba92d375332 |
|
BLAKE2b-256 | bb050b70703a0e27261ece74f93c3565648d732882b351cd14e4d1d0919855eb |