Skip to main content

debugtoolbar for aiohttp

Project description

|Build status| |Coverage status|

aiohttp_debugtoolbar provides a debug toolbar for your aiohttp web application. Library is port of pyramid_debugtoolbar and still in early development stages. Basic functionality has been ported:

  • basic panels

  • intercept redirects

  • intercept and pretty print exception

  • interactive python console

  • show source code

Ported Panels

HeaderDebugPanel, PerformanceDebugPanel, TracebackPanel, SettingsDebugPanel, MiddlewaresDebugPanel, VersionDebugPanel, RoutesDebugPanel, RequestVarsDebugPanel

Help Needed

Are you an experienced coder looking for a project to contribute to python/asyncio libraries? This is the project for you!

Install and Configuration

$ pip install aiohttp_debugtoolbar

In order to plug in aiohttp_debugtoolbar you have to attach middleware to your aiohttp.web.Application, and call aiohttp_debugtoolbar.setup

import aiohttp_debugtoolbar
app = web.Application(loop=loop,

Full Example

import asyncio
import aiohttp_debugtoolbar
import aiohttp_mako

from aiohttp import web

def basic_handler(request):
    return {'title': 'example aiohttp_debugtoolbar!',
            'text': 'Hello aiohttp_debugtoolbar!',

def exception_handler(request):
    raise NotImplementedError

def init(loop):
    # add aiohttp_debugtoolbar middleware to you application
    app = web.Application(loop=loop,
    # install aiohttp_debugtoolbar

    # install mako templates
    lookup = aiohttp_mako.setup(app, input_encoding='utf-8',
    template = """
              <a href="${app.router['exc_example'].url()}">
              Exception example</a>
    lookup.put_string('index.html', template)

    app.router.add_route('GET', '/', basic_handler, name='index')
    app.router.add_route('GET', '/exc',
                         exception_handler, name='exc_example')

    handler = app.make_handler()
    srv = yield from loop.create_server(handler, '', 9000)
    print("Server started at")
    return srv, handler

loop = asyncio.get_event_loop()
srv, handler = loop.run_until_complete(init(loop))
except KeyboardInterrupt:

Play With Demo


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiohttp_debugtoolbar-0.0.2.tar.gz (403.8 kB view hashes)

Uploaded source

Built Distribution

aiohttp_debugtoolbar-0.0.2-py3-none-any.whl (422.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page