All Projects → aio-libs → Aiohttp Debugtoolbar

aio-libs / Aiohttp Debugtoolbar

Licence: apache-2.0
aiohttp_debugtoolbar is library for debugtoolbar support for aiohttp

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Aiohttp Debugtoolbar

Aiohttp
Asynchronous HTTP client/server framework for asyncio and Python
Stars: ✭ 11,972 (+6442.08%)
Mutual labels:  asyncio, aiohttp
Aiohttp Apispec
Build and document REST APIs with aiohttp and apispec
Stars: ✭ 172 (-6.01%)
Mutual labels:  asyncio, aiohttp
Pymxget
mxget的Python实现
Stars: ✭ 136 (-25.68%)
Mutual labels:  asyncio, aiohttp
Aiohttp Cors
CORS support for aiohttp
Stars: ✭ 173 (-5.46%)
Mutual labels:  asyncio, aiohttp
Aiohttp Session
Web sessions for aiohttp.web
Stars: ✭ 171 (-6.56%)
Mutual labels:  asyncio, aiohttp
Aioelasticsearch
aioelasticsearch-py wrapper for asyncio
Stars: ✭ 127 (-30.6%)
Mutual labels:  asyncio, aiohttp
Aiozipkin
Distributed tracing instrumentation for asyncio with zipkin
Stars: ✭ 161 (-12.02%)
Mutual labels:  asyncio, aiohttp
Aioauth
Asynchronous OAuth 2.0 framework and provider for Python 3
Stars: ✭ 102 (-44.26%)
Mutual labels:  asyncio, aiohttp
Linkedin Learning Downloader
Linkedin Learning videos downloader
Stars: ✭ 171 (-6.56%)
Mutual labels:  asyncio, aiohttp
Kubernetes asyncio
Python asynchronous client library for Kubernetes http://kubernetes.io/
Stars: ✭ 147 (-19.67%)
Mutual labels:  asyncio, aiohttp
Aiohttp Sse
Server-sent events support for aiohttp
Stars: ✭ 125 (-31.69%)
Mutual labels:  asyncio, aiohttp
Owllook
owllook-小说搜索引擎
Stars: ✭ 2,163 (+1081.97%)
Mutual labels:  asyncio, aiohttp
Tgfilestream
A Telegram bot that can stream Telegram files to users over HTTP.
Stars: ✭ 113 (-38.25%)
Mutual labels:  asyncio, aiohttp
Backendschool2019
Приложение для практического руководства по разработке бекенд-сервисов на Python (на основе вступительного испытания в Школу бэкенд‑разработки Яндекса)
Stars: ✭ 129 (-29.51%)
Mutual labels:  asyncio, aiohttp
Sockjs
SockJS Server
Stars: ✭ 105 (-42.62%)
Mutual labels:  asyncio, aiohttp
Aioinflux
Asynchronous Python client for InfluxDB
Stars: ✭ 142 (-22.4%)
Mutual labels:  asyncio, aiohttp
Rororo
Implement aiohttp.web OpenAPI 3 server applications with schema first approach.
Stars: ✭ 95 (-48.09%)
Mutual labels:  asyncio, aiohttp
Ruia
Async Python 3.6+ web scraping micro-framework based on asyncio
Stars: ✭ 1,366 (+646.45%)
Mutual labels:  asyncio, aiohttp
Python Simple Rest Client
Simple REST client for python 3.6+
Stars: ✭ 143 (-21.86%)
Mutual labels:  asyncio, aiohttp
Aiohttp Jinja2
jinja2 template renderer for aiohttp.web
Stars: ✭ 180 (-1.64%)
Mutual labels:  asyncio, aiohttp

aiohttp-debugtoolbar

.. image:: https://travis-ci.org/aio-libs/aiohttp-debugtoolbar.svg?branch=master :target: https://travis-ci.org/aio-libs/aiohttp-debugtoolbar :alt: |Build status| .. image:: https://codecov.io/gh/aio-libs/aiohttp-debugtoolbar/branch/master/graph/badge.svg :target: https://codecov.io/gh/aio-libs/aiohttp-debugtoolbar :alt: |Coverage status| .. image:: https://img.shields.io/pypi/v/aiohttp-debugtoolbar.svg :target: https://pypi.python.org/pypi/aiohttp-debugtoolbar :alt: PyPI .. image:: https://badges.gitter.im/Join%20Chat.svg :target: https://gitter.im/aio-libs/Lobby :alt: Chat on Gitter

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

.. image:: https://raw.githubusercontent.com/aio-libs/aiohttp_debugtoolbar/master/demo/aiohttp_debugtoolba_sceenshot.png

Ported Panels

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

Help Needed

Are you 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, call aiohttp_debugtoolbar.setup on your app.

.. code:: python

import aiohttp_debugtoolbar
app = web.Application(loop=loop)
aiohttp_debugtoolbar.setup(app)

Full Example

.. code:: python

import asyncio
import jinja2
import aiohttp_debugtoolbar
import aiohttp_jinja2

from aiohttp import web


@aiohttp_jinja2.template('index.html')
async def basic_handler(request):
    return {'title': 'example aiohttp_debugtoolbar!',
            'text': 'Hello aiohttp_debugtoolbar!',
            'app': request.app}


async def exception_handler(request):
    raise NotImplementedError


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

    template = """
    <html>
        <head>
            <title>{{ title }}</title>
        </head>
        <body>
            <h1>{{ text }}</h1>
            <p>
              <a href="{{ app.router['exc_example'].url() }}">
              Exception example</a>
            </p>
        </body>
    </html>
    """
    # install jinja2 templates
    loader = jinja2.DictLoader({'index.html': template})
    aiohttp_jinja2.setup(app, loader=loader)

    # init routes for index page, and page with error
    app.router.add_route('GET', '/', basic_handler, name='index')
    app.router.add_route('GET', '/exc', exception_handler,
                         name='exc_example')
    return app


loop = asyncio.get_event_loop()
app = loop.run_until_complete(init(loop))
web.run_app(app, host='127.0.0.1', port=9000)

Settings

.. code:: python

aiohttp_debugtoolbar.setup(app, hosts=['172.19.0.1', ])

Supported options

  • enabled: The debugtoolbar is disabled if False. By default is set to True.
  • intercept_redirects: If True, intercept redirect and display an intermediate page with a link to the redirect page. By default is set to True.
  • hosts: The list of allow hosts. By default is set to ['127.0.0.1', '::1'].
  • exclude_prefixes: The list of forbidden hosts. By default is set to [].
  • check_host: If False, disable the host check and display debugtoolbar for any host. By default is set to True.
  • max_request_history: The max value for storing requests. By default is set to 100.
  • max_visible_requests: The max value of display requests. By default is set to 10.
  • path_prefix: The prefix of path to debugtoolbar. By default is set to '/_debugtoolbar'.

Thanks!

I've borrowed a lot of code from following projects. I highly recommend to check them out:

  • pyramid_debugtoolbar_
  • django-debug-toolbar_
  • flask-debugtoolbar_

Play With Demo

https://github.com/aio-libs/aiohttp_debugtoolbar/tree/master/demo

Requirements

  • Python_ 3.4+
  • aiohttp_
  • aiohttp_jinja2_

.. _Python: https://www.python.org .. _asyncio: http://docs.python.org/3.4/library/asyncio.html .. _aiohttp: https://github.com/KeepSafe/aiohttp .. _aiopg: https://github.com/aio-libs/aiopg .. _aiomysql: https://github.com/aio-libs/aiomysql .. _aiohttp_jinja2: https://github.com/aio-libs/aiohttp_jinja2 .. _pyramid_debugtoolbar: https://github.com/Pylons/pyramid_debugtoolbar .. _django-debug-toolbar: https://github.com/django-debug-toolbar/django-debug-toolbar .. _flask-debugtoolbar: https://github.com/mgood/flask-debugtoolbar

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].