This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Okupy/Profiling and Debugging

From Gentoo Wiki (test)
< Okupy
Jump to:navigation Jump to:search

Profiling

Required packages: hotshot

Option 1

Option 2

Debugging

  • Required packages: django-debug-toolbar
  • Optional packages: https://github.com/django-debug-toolbar/django-debug-toolbar/wiki/3rd-Party-Panels
  • Make sure your IP is listed in the INTERNAL_IPS local.py/development.py settings. If you are working locally this will be: INTERNAL_IPS = ('127.0.0.1',)
  • Add the following middleware to local.py/development.py file: MIDDLEWARE_CLASSES = ( 'debug_toolbar.middleware.DebugToolbarMiddleware', )
  • Add debug_toolbar to your INSTALLED_APPS setting INSTALLED_APPS = ( 'debug_toolbar', )
  • Add a tuple called DEBUG_TOOLBAR_PANELS to your settings.py file that specifies the full Python path to the panel that you want included in the Toolbar.
DEBUG_TOOLBAR_PANELS = ( 'debug_toolbar.panels.version.VersionDebugPanel', 'debug_toolbar.panels.timer.TimerDebugPanel',
'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel', 'debug_toolbar.panels.headers.HeaderDebugPanel',
'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', 'debug_toolbar.panels.template.TemplateDebugPanel',
'debug_toolbar.panels.sql.SQLDebugPanel', 'debug_toolbar.panels.signals.SignalDebugPanel', 'debug_toolbar.panels.logger.LoggingPanel', )

Reference: https://github.com/django-debug-toolbar/django-debug-toolbar

Front-end profiling

  • Firefox: Shift+F5 to start profiler or Right-click --> Inspect element --> Profiler
  • Features: 3D view, Responsive design mode, times
  • TODO: Chrome Dev tools