Skip to content

prologin/django-pypprof

Repository files navigation

django-pypprof

django-pypprof is a wrapper of pypprof for ease of use with Django.

Installation

Install the package:

pip install django-pypprof --extra-index-url https://gitlab.com/api/v4/groups/prologin/-/packages/pypi/simple

Add it to your INSTALLED_APPS:

INSTALLED_APPS = [
  ...
  "django_pypprof",
  ...
]

Add the urls to your urls.py:

urlpatterns = [
  ...
  path("debug/pprof/", include("django_pypprof.urls")),
  ...
]

### Configuration

You can configure the sample rate of mprofile by adding the following setting:

PPROF_SAMPLE_RATE = 128 * 1024 # the default