@@ -270,7 +270,79 @@ def about():
270270```
271271
272272
273- ## Example 4 from flask_jsondash
273+ ## Example 4 from flask-debugtoolbar
274+ [Flask Debug-toolbar](https://github.com/flask-debugtoolbar/flask-debugtoolbar)
275+ ([documentation](https://flask-debugtoolbar.readthedocs.io/en/latest/)
276+ and
277+ [PyPI page](https://pypi.org/project/Flask-DebugToolbar/))
278+ is a [Flask](/flask.html) conversion of the popular
279+ [Django Debug Toolbar](https://github.com/jazzband/django-debug-toolbar)
280+ project. This extension creates a sidebar with useful debugging
281+ information when you are running a Flask application in development
282+ mode. The project is provided as open source under
283+ [this license](https://github.com/flask-debugtoolbar/flask-debugtoolbar/blob/master/LICENSE).
284+
285+ [**flask-debugtoolbar / flask_debugtoolbar / __init__.py**](https://github.com/flask-debugtoolbar/flask-debugtoolbar/blob/master/flask_debugtoolbar/./__init__.py)
286+
287+ ```python
288+ # __init__.py
289+ import os
290+ import warnings
291+
292+ ~~from flask import Blueprint, current_app, request, g, send_from_directory, url_for
293+ from flask.globals import _request_ctx_stack
294+ from jinja2 import Environment, PackageLoader
295+ from werkzeug.urls import url_quote_plus
296+
297+ from flask_debugtoolbar.compat import iteritems
298+ from flask_debugtoolbar.toolbar import DebugToolbar
299+ from flask_debugtoolbar.utils import decode_text
300+
301+ try:
302+ # Python 3.8+
303+ from importlib.metadata import version
304+
305+ __version__ = version("Flask-DebugToolbar")
306+ except ImportError:
307+ import pkg_resources
308+
309+ __version__ = pkg_resources.get_distribution("Flask-DebugToolbar").version
310+
311+
312+ ~~module = Blueprint('debugtoolbar', __name__)
313+
314+
315+ def replace_insensitive(string, target, replacement):
316+ """ Similar to string.replace() but is case insensitive
317+ Code borrowed from :
318+ http:// forums.devshed.com/ python- programming- 11 / case- insensitive- string- replace- 490921. html
319+ """
320+ no_case = string.lower()
321+ index = no_case.rfind(target.lower())
322+ if index >= 0:
323+ return string[:index] + replacement + string[index + len(target):]
324+ else: # no results so return the original string
325+ return string
326+
327+
328+ def _printable(value):
329+ try:
330+ return decode_text(repr(value))
331+ except Exception as e:
332+ return '<repr(%s ) raised %s : %s >' % (
333+ object.__repr__(value), type(e).__name__, e)
334+
335+
336+ class DebugToolbarExtension(object):
337+
338+
339+ ## ... source file continues with no further Blueprint examples...
340+
341+
342+ ```
343+
344+
345+ ## Example 5 from flask_jsondash
274346[Flask JSONDash](https://github.com/christabor/flask_jsondash) is a
275347configurable web application built in Flask that creates charts and
276348dashboards from arbitrary API endpoints. Everything for the web app
@@ -356,7 +428,7 @@ def auth(**kwargs):
356428```
357429
358430
359- ## Example 5 from flask-restx
431+ ## Example 6 from flask-restx
360432[Flask RESTX](https://github.com/python-restx/flask-restx) is an
361433extension that makes it easier to build
362434[RESTful APIs](/application-programming-interfaces.html) into
@@ -410,7 +482,7 @@ apidoc = Apidoc(
410482```
411483
412484
413- ## Example 6 from Flask-WTF
485+ ## Example 7 from Flask-WTF
414486[Flask-WTF](https://github.com/lepture/flask-wtf)
415487([project documentation](https://flask-wtf.readthedocs.io/en/stable/)
416488and
@@ -519,7 +591,7 @@ def generate_csrf(secret_key=None, token_key=None):
519591```
520592
521593
522- # # Example 7 from flaskSaaS
594+ # # Example 8 from flaskSaaS
523595[flaskSaas](https:// github.com/ alectrocute/ flaskSaaS) is a boilerplate
524596starter project to build a software- as - a- service (SaaS) web application
525597in [Flask](/ flask.html), with [Stripe](/ stripe.html) for billing. The
@@ -590,7 +662,7 @@ def signup():
590662```
591663
592664
593- # # Example 8 from tedivms-flask
665+ # # Example 9 from tedivms-flask
594666[tedivm' s flask starter app](https://github.com/tedivm/tedivms-flask) is a
595667base of [Flask](/ flask.html) code and related projects such as
596668[Celery](/ celery.html) which provides a template to start your own
0 commit comments