aiohttp-debugtoolbar


Nameaiohttp-debugtoolbar JSON
Version 0.6.1 PyPI version JSON
download
home_pagehttps://github.com/aio-libs/aiohttp_debugtoolbar
Summarydebugtoolbar for aiohttp
upload_time2023-11-19 22:40:21
maintainer
docs_urlNone
authorNikolay Novik
requires_python
licenseApache 2
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            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
------------

* aiohttp_
* aiohttp_jinja2_


.. _Python: https://www.python.org
.. _asyncio: http://docs.python.org/3/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

=======
CHANGES
=======

.. towncrier release notes start

0.6.1 (2023-11-19)
==================

- Filtered out requests to debugtoolbar itself from the requests history.
- Improved import time by delaying loading of package data.
- Fixed static URLs when using yarl 1.9+.
- Fixed a warning in the ``re`` module.
- Switched to ``aiohttp.web.AppKey`` for aiohttp 3.9.
- Dropped Python 3.7 and added Python 3.11.

0.6.0 (2020-01-25)
==================

- Fixed ClassBasedView support. #207
- Dropped aiohttp<3.3 support.
- Dropped Python 3.4 support.
- Dropped ``yield from`` and ``@asyncio.coroutine`` support.

0.5.0 (2018-02-14)
==================

- Added safe filter to render_content. #195
- Added support for aiohtp 3.

0.4.1 (2017-08-30)
==================

- Fixed issue with redirects without location header. #174

0.4.0 (2017-05-04)
==================

- Added asyncio trove classifier.
- Addes support for aiohttp 2.0.7+.

0.3.0 (2016-11-18)
==================

- Fixed middleware route finding when using sub-apps. #65
- Added examples for extra panels: pgsql & redis monitor. #59

0.2.0 (2016-11-08)
==================

- Refactored test suite.

0.1.4 (2016-11-07)
==================

- Renamed to aiohttp-debugtoolbar.
- Fixed imcompatibility with aiohttp 1.1.

0.1.3 (2016-10-27)
==================

- Fixed a link to request info page, sort request information alphabetically. #52

0.1.2 (2016-09-27)
==================

- Fixed empty functions names in performance panel. #43 (Thanks @kammala!)
- Fixed flashing message during page rendering issue. #46

0.1.1 (2016-02-21)
==================

- Fixed a demo.
- Added syntax highlight in traceback view, switched highlighter from
  highlight.js to prism.js. #31

0.1.0 (2016-02-13)
==================

- Added Python 3.5 support. (Thanks @stormandco!)
- Added view source button in RoutesDebugPanel. (Thanks @stormandco!)
- Dropped support for Python 3.3. (Thanks @sloria!)
- Added middleware in setup method. (Thanks @sloria!)
- Fixed bug with interactive console.
- Fixed support for aiohttp>=0.21.1.

0.0.5 (2015-09-13)
==================

- Fixed IPv6 socket family error. (Thanks @stormandco!)

0.0.4 (2015-09-05)
==================

- Fixed support for aiohttp>=0.17. (Thanks @himikof!)

0.0.3 (2015-07-03)
==================

- Switched template engine from mako to jinja2. (Thanks @iho!)
- Added custom *yield from* to track context switches inside coroutine.
- Implemented panel for collecting request log messages.
- Disable toolbar code injecting for non web.Response answers
  (StreamResponse or WebSocketResponse for example). #12

0.0.2 (2015-05-26)
==================

- Redesigned UI look-and-feel.
- Renamed `toolbar_middleware_factory` to just `middleware`.

0.0.1 (2015-05-18)
==================

- Initial release.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aio-libs/aiohttp_debugtoolbar",
    "name": "aiohttp-debugtoolbar",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Nikolay Novik",
    "author_email": "nickolainovik@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bd/72/cd80c0d1d425d5ef50e5b23553040e8d9fa5de5714208d3d18ae8806b6de/aiohttp-debugtoolbar-0.6.1.tar.gz",
    "platform": null,
    "description": "aiohttp-debugtoolbar\n====================\n.. image:: https://travis-ci.org/aio-libs/aiohttp-debugtoolbar.svg?branch=master\n    :target: https://travis-ci.org/aio-libs/aiohttp-debugtoolbar\n    :alt: |Build status|\n.. image:: https://codecov.io/gh/aio-libs/aiohttp-debugtoolbar/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/aio-libs/aiohttp-debugtoolbar\n    :alt: |Coverage status|\n.. image:: https://img.shields.io/pypi/v/aiohttp-debugtoolbar.svg\n    :target: https://pypi.python.org/pypi/aiohttp-debugtoolbar\n    :alt: PyPI\n.. image:: https://badges.gitter.im/Join%20Chat.svg\n    :target: https://gitter.im/aio-libs/Lobby\n    :alt: Chat on Gitter\n\n**aiohttp_debugtoolbar** provides a debug toolbar for your aiohttp_\nweb application.  Library is port of pyramid_debugtoolbar_ and\nstill in early development stages. Basic functionality has been\nported:\n\n* basic panels\n* intercept redirects\n* intercept and pretty print exception\n* interactive python console\n* show source code\n\n.. image:: https://raw.githubusercontent.com/aio-libs/aiohttp_debugtoolbar/master/demo/aiohttp_debugtoolba_sceenshot.png\n\n\nPorted Panels\n-------------\n``HeaderDebugPanel``, ``PerformanceDebugPanel``, ``TracebackPanel``,\n``SettingsDebugPanel``, ``MiddlewaresDebugPanel``, ``VersionDebugPanel``,\n``RoutesDebugPanel``,  ``RequestVarsDebugPanel``, ``LoggingPanel``\n\n\nHelp Needed\n-----------\nAre you coder looking for a project to contribute to\npython/asyncio libraries? This is the project for you!\n\n\nInstall and Configuration\n-------------------------\n::\n\n    $ pip install aiohttp_debugtoolbar\n\n\nIn order to plug in ``aiohttp_debugtoolbar``, call\n``aiohttp_debugtoolbar.setup`` on your app.\n\n.. code:: python\n\n    import aiohttp_debugtoolbar\n    app = web.Application(loop=loop)\n    aiohttp_debugtoolbar.setup(app)\n\n\nFull Example\n------------\n\n.. code:: python\n\n    import asyncio\n    import jinja2\n    import aiohttp_debugtoolbar\n    import aiohttp_jinja2\n\n    from aiohttp import web\n\n\n    @aiohttp_jinja2.template('index.html')\n    async def basic_handler(request):\n        return {'title': 'example aiohttp_debugtoolbar!',\n                'text': 'Hello aiohttp_debugtoolbar!',\n                'app': request.app}\n\n\n    async def exception_handler(request):\n        raise NotImplementedError\n\n\n    async def init(loop):\n        # add aiohttp_debugtoolbar middleware to you application\n        app = web.Application(loop=loop)\n        # install aiohttp_debugtoolbar\n        aiohttp_debugtoolbar.setup(app)\n\n        template = \"\"\"\n        <html>\n            <head>\n                <title>{{ title }}</title>\n            </head>\n            <body>\n                <h1>{{ text }}</h1>\n                <p>\n                  <a href=\"{{ app.router['exc_example'].url() }}\">\n                  Exception example</a>\n                </p>\n            </body>\n        </html>\n        \"\"\"\n        # install jinja2 templates\n        loader = jinja2.DictLoader({'index.html': template})\n        aiohttp_jinja2.setup(app, loader=loader)\n\n        # init routes for index page, and page with error\n        app.router.add_route('GET', '/', basic_handler, name='index')\n        app.router.add_route('GET', '/exc', exception_handler,\n                             name='exc_example')\n        return app\n\n\n    loop = asyncio.get_event_loop()\n    app = loop.run_until_complete(init(loop))\n    web.run_app(app, host='127.0.0.1', port=9000)\n\nSettings\n--------\n.. code:: python\n\n    aiohttp_debugtoolbar.setup(app, hosts=['172.19.0.1', ])\n\nSupported options\n\n\n- enabled: The debugtoolbar is disabled if False. By default is set to True.\n- intercept_redirects: If True, intercept redirect and display an intermediate page with a link to the redirect page. By default is set to True.\n- hosts: The list of allow hosts. By default is set to ['127.0.0.1', '::1'].\n- exclude_prefixes: The list of forbidden hosts. By default is set to [].\n- check_host: If False, disable the host check and display debugtoolbar for any host. By default is set to True.\n- max_request_history: The max value for storing requests. By default is set to 100.\n- max_visible_requests: The max value of display requests. By default is set to 10.\n- path_prefix: The prefix of path to debugtoolbar. By default is set to '/_debugtoolbar'.\n\n\nThanks!\n-------\n\nI've borrowed a lot of code from following projects. I highly\nrecommend to check them out:\n\n* pyramid_debugtoolbar_\n* django-debug-toolbar_\n* flask-debugtoolbar_\n\nPlay With Demo\n--------------\n\nhttps://github.com/aio-libs/aiohttp_debugtoolbar/tree/master/demo\n\nRequirements\n------------\n\n* aiohttp_\n* aiohttp_jinja2_\n\n\n.. _Python: https://www.python.org\n.. _asyncio: http://docs.python.org/3/library/asyncio.html\n.. _aiohttp: https://github.com/KeepSafe/aiohttp\n.. _aiopg: https://github.com/aio-libs/aiopg\n.. _aiomysql: https://github.com/aio-libs/aiomysql\n.. _aiohttp_jinja2: https://github.com/aio-libs/aiohttp_jinja2\n.. _pyramid_debugtoolbar: https://github.com/Pylons/pyramid_debugtoolbar\n.. _django-debug-toolbar: https://github.com/django-debug-toolbar/django-debug-toolbar\n.. _flask-debugtoolbar: https://github.com/mgood/flask-debugtoolbar\n\n=======\nCHANGES\n=======\n\n.. towncrier release notes start\n\n0.6.1 (2023-11-19)\n==================\n\n- Filtered out requests to debugtoolbar itself from the requests history.\n- Improved import time by delaying loading of package data.\n- Fixed static URLs when using yarl 1.9+.\n- Fixed a warning in the ``re`` module.\n- Switched to ``aiohttp.web.AppKey`` for aiohttp 3.9.\n- Dropped Python 3.7 and added Python 3.11.\n\n0.6.0 (2020-01-25)\n==================\n\n- Fixed ClassBasedView support. #207\n- Dropped aiohttp<3.3 support.\n- Dropped Python 3.4 support.\n- Dropped ``yield from`` and ``@asyncio.coroutine`` support.\n\n0.5.0 (2018-02-14)\n==================\n\n- Added safe filter to render_content. #195\n- Added support for aiohtp 3.\n\n0.4.1 (2017-08-30)\n==================\n\n- Fixed issue with redirects without location header. #174\n\n0.4.0 (2017-05-04)\n==================\n\n- Added asyncio trove classifier.\n- Addes support for aiohttp 2.0.7+.\n\n0.3.0 (2016-11-18)\n==================\n\n- Fixed middleware route finding when using sub-apps. #65\n- Added examples for extra panels: pgsql & redis monitor. #59\n\n0.2.0 (2016-11-08)\n==================\n\n- Refactored test suite.\n\n0.1.4 (2016-11-07)\n==================\n\n- Renamed to aiohttp-debugtoolbar.\n- Fixed imcompatibility with aiohttp 1.1.\n\n0.1.3 (2016-10-27)\n==================\n\n- Fixed a link to request info page, sort request information alphabetically. #52\n\n0.1.2 (2016-09-27)\n==================\n\n- Fixed empty functions names in performance panel. #43 (Thanks @kammala!)\n- Fixed flashing message during page rendering issue. #46\n\n0.1.1 (2016-02-21)\n==================\n\n- Fixed a demo.\n- Added syntax highlight in traceback view, switched highlighter from\n  highlight.js to prism.js. #31\n\n0.1.0 (2016-02-13)\n==================\n\n- Added Python 3.5 support. (Thanks @stormandco!)\n- Added view source button in RoutesDebugPanel. (Thanks @stormandco!)\n- Dropped support for Python 3.3. (Thanks @sloria!)\n- Added middleware in setup method. (Thanks @sloria!)\n- Fixed bug with interactive console.\n- Fixed support for aiohttp>=0.21.1.\n\n0.0.5 (2015-09-13)\n==================\n\n- Fixed IPv6 socket family error. (Thanks @stormandco!)\n\n0.0.4 (2015-09-05)\n==================\n\n- Fixed support for aiohttp>=0.17. (Thanks @himikof!)\n\n0.0.3 (2015-07-03)\n==================\n\n- Switched template engine from mako to jinja2. (Thanks @iho!)\n- Added custom *yield from* to track context switches inside coroutine.\n- Implemented panel for collecting request log messages.\n- Disable toolbar code injecting for non web.Response answers\n  (StreamResponse or WebSocketResponse for example). #12\n\n0.0.2 (2015-05-26)\n==================\n\n- Redesigned UI look-and-feel.\n- Renamed `toolbar_middleware_factory` to just `middleware`.\n\n0.0.1 (2015-05-18)\n==================\n\n- Initial release.\n",
    "bugtrack_url": null,
    "license": "Apache 2",
    "summary": "debugtoolbar for aiohttp",
    "version": "0.6.1",
    "project_urls": {
        "Homepage": "https://github.com/aio-libs/aiohttp_debugtoolbar"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6daefe3fe922b6efb0c27e6244c99d60330f8f3f39de42510137bf7c205adeb4",
                "md5": "66e66dabe0c903cf1efc1ff3199521ac",
                "sha256": "cbb876a350bbca497f8c46fff96d0ebdbd552ba6d0bb80ec3a5e95270b0f1f65"
            },
            "downloads": -1,
            "filename": "aiohttp_debugtoolbar-0.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "66e66dabe0c903cf1efc1ff3199521ac",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 466050,
            "upload_time": "2023-11-19T22:40:19",
            "upload_time_iso_8601": "2023-11-19T22:40:19.115276Z",
            "url": "https://files.pythonhosted.org/packages/6d/ae/fe3fe922b6efb0c27e6244c99d60330f8f3f39de42510137bf7c205adeb4/aiohttp_debugtoolbar-0.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd72cd80c0d1d425d5ef50e5b23553040e8d9fa5de5714208d3d18ae8806b6de",
                "md5": "3be0e457798dbd301f4cfe8da43166d4",
                "sha256": "cd7ae54c600db7ae7d9dc3404b81f95209a6367df1d59e13ea20f9926e36e001"
            },
            "downloads": -1,
            "filename": "aiohttp-debugtoolbar-0.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3be0e457798dbd301f4cfe8da43166d4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 451126,
            "upload_time": "2023-11-19T22:40:21",
            "upload_time_iso_8601": "2023-11-19T22:40:21.313453Z",
            "url": "https://files.pythonhosted.org/packages/bd/72/cd80c0d1d425d5ef50e5b23553040e8d9fa5de5714208d3d18ae8806b6de/aiohttp-debugtoolbar-0.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-19 22:40:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aio-libs",
    "github_project": "aiohttp_debugtoolbar",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "aiohttp-debugtoolbar"
}
        
Elapsed time: 0.18726s