Created
April 12, 2015 21:16
-
-
Save eevmanu/dd3e1056dbc8038b3fb1 to your computer and use it in GitHub Desktop.
Using silk as a profiler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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