README.rst 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. ==================
  2. Django Debug Panel
  3. ==================
  4. Django Debug Toolbar inside WebKit DevTools. Works fine with background AJAX requests and non-HTML responses.
  5. Great for single-page applications and other AJAX intensive web applications.
  6. Installation
  7. ============
  8. #. Install and configure `Django Debug Toolbar <https://github.com/django-debug-toolbar/django-debug-toolbar>`_
  9. #. Install Django Debug Panel:
  10. .. code-block:: bash
  11. pip install django-debug-panel
  12. #. Add ``debug_panel`` to your ``INSTALLED_APPS`` setting:
  13. .. code-block:: python
  14. INSTALLED_APPS = (
  15. # ...
  16. 'debug_panel',
  17. )
  18. #. Replace the Django Debug Toolbar middleware with the Django Debug Panel one. Replace:
  19. .. code-block:: python
  20. MIDDLEWARE_CLASSES = (
  21. ...
  22. 'debug_toolbar.middleware.DebugToolbarMiddleware',
  23. ...
  24. )
  25. with:
  26. .. code-block:: python
  27. MIDDLEWARE_CLASSES = (
  28. ...
  29. 'debug_panel.middleware.DebugPanelMiddleware',
  30. ...
  31. )
  32. #. (Optional) Configure your cache.
  33. All the debug data of a request are stored into the cache backend ``debug-panel``
  34. if available. Otherwise, the ``default`` backend is used, and finally if no caches are
  35. defined it will fallback to a local memory cache.
  36. You might want to configure the ``debug-panel`` cache in your ``settings``:
  37. .. code-block:: python
  38. CACHES = {
  39. 'default': {
  40. 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
  41. 'LOCATION': '127.0.0.1:11211',
  42. },
  43. # this cache backend will be used by django-debug-panel
  44. 'debug-panel': {
  45. 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
  46. 'LOCATION': '/var/tmp/debug-panel-cache',
  47. 'OPTIONS': {
  48. 'MAX_ENTRIES': 200
  49. }
  50. }
  51. }
  52. #. Install the Chrome extension `Django Debug Panel <https://chrome.google.com/webstore/detail/django-debug-panel/nbiajhhibgfgkjegbnflpdccejocmbbn>`_