Skip to content

Instantly share code, notes, and snippets.

@eevmanu
Created April 12, 2015 21:16
Show Gist options
  • Save eevmanu/dd3e1056dbc8038b3fb1 to your computer and use it in GitHub Desktop.
Save eevmanu/dd3e1056dbc8038b3fb1 to your computer and use it in GitHub Desktop.
Using silk as a profiler
1. install silk with all its requirements
pip install django-silk
simplejson
python-dateutil
Jinja2
pep8
autopep8
pytz
MarkupSafe
Pygments
2. change this in MIDDLEWARE_CLASSES
MIDDLEWARE_CLASSES = (
'silk.middleware.SilkyMiddleware',
) + MIDDLEWARE_CLASSES
3. change in INSTALLED_APPS
INSTALLED_APPS += (
...
'silk',
...
)
4. add this in urls.py
if settings.DEBUG:
import debug_toolbar
urlpatterns += patterns(
'',
url(r'^__debug__/', include(debug_toolbar.urls)),
url(r'^silk/', include('silk.urls', namespace='silk'))
)
5. execute this line
python manage.py syncdb
this will add initial migration of silk
And that's all!.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment