pixelpassion / django-saas-boilerplate

A Django + django-rest-framework + Heroku + SaaS application boilerplate
MIT License
51 stars 10 forks source link

Silk profiler #14

Open jensneuhaus opened 5 years ago

jensneuhaus commented 5 years ago

☝️What is it? Why do we need it?

We might add django-silk. It helps with profiling views and checking on eventual problems.

💭 Implementation details

We could enable it, when DEBUG=True + STAGE=local (or we use the extra setting SILK_PROFILER)

SILKY_PROFILER = env.bool("SILKY_PROFILER", False)

if SILKY_PROFILER is True:

    # Do not use potentially insecure and unnecessary apps in production
    INSTALLED_APPS += ["silk"]

    MIDDLEWARE = MIDDLEWARE + ["silk.middleware.SilkyMiddleware"]

    SILKY_AUTHENTICATION = True  # User must login
    SILKY_AUTHORISATION = True  # User must have permissions
    SILKY_META = env.bool("SILKY_META", False)  # Log time required for profiling by Silky

📋 Todos