Giter Club home page Giter Club logo

django-debug-panel's Introduction

Django Debug Panel

Django Debug Toolbar inside WebKit DevTools. Works fine with background AJAX requests and non-HTML responses. Great for single-page applications and other AJAX intensive web applications.

Installation

  1. Install and configure Django Debug Toolbar

  2. Install Django Debug Panel:

    pip install django-debug-panel
  3. Add debug_panel to your INSTALLED_APPS setting:

    INSTALLED_APPS = (
        # ...
        'debug_panel',
    )
  4. Replace the Django Debug Toolbar middleware with the Django Debug Panel one. Replace:

    MIDDLEWARE_CLASSES = (
        ...
        'debug_toolbar.middleware.DebugToolbarMiddleware',
        ...
    )

    with:

    MIDDLEWARE_CLASSES = (
        ...
        'debug_panel.middleware.DebugPanelMiddleware',
        ...
    )
  5. (Optional) Configure your cache. All the debug data of a request are stored into the cache backend debug-panel if available. Otherwise, the default backend is used, and finally if no caches are defined it will fallback to a local memory cache. You might want to configure the debug-panel cache in your settings:

    CACHES = {
        'default': {
            'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
            'LOCATION': '127.0.0.1:11211',
        },
    
        # this cache backend will be used by django-debug-panel
        'debug-panel': {
            'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
            'LOCATION': '/var/tmp/debug-panel-cache',
            'OPTIONS': {
                'MAX_ENTRIES': 200
            }
        }
    }
  6. Install the Chrome extension Django Debug Panel

django-debug-panel's People

Contributors

recamshak avatar tokibito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-debug-panel's Issues

Panel displays 404

This almost works, but I always get a 404 when trying to view actual SQL queries, signals, etc. for an AJAX request. Is this a configuration problem? (Using

screen shot 2016-01-28 at 11 36 30 am

It's always blank

I followed the instructions (only using the django-debug-panel middleware) and installed the extension.
I just get a blank screen.
screenshot 2014-06-13 16 00 43

Doesn't work for Ajax

I see there was a fix for this issue already but its still not working. I believe i have everything configured correctly and django-debug-panel 0.7.2 loads and works great for HTTP requests with . I am running Django 1.4.3.

I have fixed the issue by overriding django DebugToolbarMiddleware.show_toolbar() in
DebugPanelMiddleware as follows:

from debug_toolbar import middleware
from django.conf import settings

def show_toolbar(request):
    if request.META.get('REMOTE_ADDR', None) not in settings.INTERNAL_IPS:
        return False

    return bool(settings.DEBUG)
middleware.show_toolbar = show_toolbar

The original DebugToolbarMiddleware.show_toolbar() was returning false when request.is_ajax().

How do you clear the requests?

If I clear my debug_panel cache I still see my old requests in the Django Debug Panel Chrome extension. When you click on them there is no data, but it would be nice clear out all previous requests.

Doesn't work with AJAX only refreshing part of the page

If I have a web app that only refreshes certain parts of the page via AJAX (i.e. and then uses Javascript to update the DOM), those requests don't show up. Is there some way to configure this to enable all requests to be profiled, not just the ones for the "current" URL?

Django Debug Panel is empty

Hi I cannot see any output for Chrome Version 52.0.2743.116.

DDT is working and DDP's cache file are created correctly in debug-panel-cache directory.

image

Doesn't work for Ajax

I might be missing something, but it doesn't seem to work for Ajax calls for me.
looking at the middleware.py code and I see:

if not toolbar or request.is_ajax() or getattr(response, 'streaming', False):
    return response

so how is that supposed to work for ajax calls?

Doesn't work on Chrome 65

Ajax requests are not showing in Django Debug Panel Chrome extension. Chrome version 65.0.3325.181. Latest 64 version works.

Latest version not on PyPi

$ pip install django-debug-panel==0.8.3
Collecting django-debug-panel==0.8.3
  Could not find a version that satisfies the requirement django-debug-panel==0.8.3 (from versions: 0.5.1, 0.5.2, 0.5.3, 0.5.5, 0.5.6, 0.5.7, 0.5.8, 0.5.9, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 0.8.1, 0.8.2)
No matching distribution found for django-debug-panel==0.8.3
$

The version bump commit pushes to 0.8.3 ab867ac and pypi also thinks that this version is available https://pypi.python.org/pypi/django-debug-panel/0.8.3

Any ideas why pip can't find this version?

Couldn't display AJAX calls

I installed & configured django-debug-panel, but list of requests on "Django Debug" page of Google Chrome Devtools stayed empty. Turned out, that simply commenting out lines 59 and 60 on DebugToolbarMiddleware (yep, toolbar!) fixed the problem and I'm able to list AJAX requests with django-debug-panel.

        # Don't render the toolbar during AJAX requests.
        # if request.is_ajax():
        #     return

django.conf.urls.patterns() is deprecated and will be removed in Django 1.10.

/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/debug_panel/urls.py:15: RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead.
  url(r'^%s/data/(?P<cache_key>\d+\.\d+)/$' % _PREFIX, 'debug_data', name='debug_data'),

Doesn't load under mod_wsgi

It would appear that django will create the middleware class instances before loading the apps under the wsgi handler.

debug_panel should either document that you need to have import debug_panel in your settings or make a middleware subclass instead of the monkey-patching

This happens for me under django 1.4.

Django 1.9.4 warning

Hi,
I got a message below (python 2.7+django 1.9.4)

[WARNING:py.warnings]**[init.py:107]: C:\Python27\lib\site-packages\debug_panel\urls.py:15: RemovedInDjango110Warning: Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got debug_data). Pass the callable instead.

App 'debug_panel' doesn't have a models module.

I am using debug_toolbar==1.5 & django==1.8.4. I have tried many versions of django-debug-panel but the error remains same.
Error when i add debug_panel to INSTALLED_APPS.
"App '%s' doesn't have a models module." % app_label)
django.core.exceptions.ImproperlyConfigured: App 'debug_panel' doesn't have a models module.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.