Skip to content
Myr

clean up code formatting in some docs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

fix warnings while building docs

authored by David Lord · committed by David Lord · parent 0e46070 · Browse files · 8 files+133 added−133 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

8 files+133 added−133 removed

  • other:+133 added−133 removed

8 files+133 added−133 removed

modified:docs/patterns/distribute.rst+12 added-14 removed
37 unmodified lines
3839Basic Setup Script40------------------4142Because you have Flask running, you have setuptools available on your system anyways.43Flask already depends upon setuptools. If you do not, fear not, there is a44script to install it for you: `ez_setup.py`_. Just download and45run with your Python interpreter.42Because you have Flask installed, you have setuptools available on your system.43Flask already depends upon setuptools.4445Standard disclaimer applies: :ref:`you better use a virtualenv46<virtualenv>`.47
16 unmodified lines
64 )6566Please keep in mind that you have to list subpackages explicitly. If you67want setuptools to lookup the packages for you automatically, you can use70the `find_packages` function::68the ``find_packages`` function::6970 from setuptools import setup, find_packages7172 setup(73 ...74 packages=find_packages()75 )7679Most parameters to the `setup` function should be self explanatory,80`include_package_data` and `zip_safe` might not be.81`include_package_data` tells setuptools to look for a :file:`MANIFEST.in` file77Most parameters to the ``setup`` function should be self explanatory,78``include_package_data`` and ``zip_safe`` might not be.79``include_package_data`` tells setuptools to look for a :file:`MANIFEST.in` file80and install all the entries that match as package data. We will use this81to distribute the static files and templates along with the Python module84(see :ref:`distributing-resources`). The `zip_safe` flag can be used to82(see :ref:`distributing-resources`). The ``zip_safe`` flag can be used to83force or prevent zip Archive creation. In general you probably don't want84your packages to be installed as zip files because some tools do not85support them and they make debugging a lot harder.86
33 unmodified lines
120 recursive-include yourapplication/static *121122Don't forget that even if you enlist them in your :file:`MANIFEST.in` file, they123won't be installed for you unless you set the `include_package_data`126parameter of the `setup` function to ``True``!124parameter of the ``setup`` function to ``True``!125126127Declaring Dependencies128----------------------129132Dependencies are declared in the `install_requires` parameter as a list.130Dependencies are declared in the ``install_requires`` parameter as a list.131Each item in that list is the name of a package that should be pulled from132PyPI on installation. By default it will always use the most recent133version, but you can also provide minimum and maximum version134requirements. Here some examples::
21 unmodified lines
156Installing / Developing157-----------------------158159To install your application (ideally into a virtualenv) just run the162:file:`setup.py` script with the `install` parameter. It will install your160:file:`setup.py` script with the ``install`` parameter. It will install your161application into the virtualenv's site-packages folder and also download162and install all dependencies::163164 $ python setup.py install165166If you are developing on the package and also want the requirements to be169installed, you can use the `develop` command instead::167installed, you can use the ``develop`` command instead::168169 $ python setup.py develop170171This has the advantage of just installing a link to the site-packages172folder instead of copying the data over. You can then continue to work on175the code without having to run `install` again after each change.173the code without having to run ``install`` again after each change.174175176.. _pip: https://pypi.python.org/pypi/pip177.. _Setuptools: https://pythonhosted.org/setuptools
modified:docs/appcontext.rst+3 added-3 removed
72 unmodified lines
73The application context is also used by the :func:`~flask.url_for`74function in case a ``SERVER_NAME`` was configured. This allows you to75generate URLs even in the absence of a request.7677If no request context has been pushed and an application context has 78not been explicitly set, a ``RuntimeError`` will be raised.79::77If no request context has been pushed and an application context has78not been explicitly set, a ``RuntimeError`` will be raised. ::7980 RuntimeError: Working outside of application context.8182Locality of the Context83-----------------------
55 unmodified lines
modified:docs/cli.rst+6 added-6 removed
30 unmodified lines
31Python module that contains a Flask application.3233In that imported file the name of the app needs to be called ``app`` or34optionally be specified after a colon. For instance35`mymodule:application` would tell it to use the `application` object in35``mymodule:application`` would tell it to use the `application` object in36the :file:`mymodule.py` file.3738Given a :file:`hello.py` file with the application in it named ``app``39this is how it can be run.
177 unmodified lines
217218CLI Plugins219-----------220221Flask extensions can always patch the `Flask.cli` instance with more221Flask extensions can always patch the :attr:`Flask.cli` instance with more222commands if they want. However there is a second way to add CLI plugins223to Flask which is through `setuptools`. If you make a Python package that224should export a Flask command line plugin you can ship a `setup.py` file223to Flask which is through ``setuptools``. If you make a Python package that224should export a Flask command line plugin you can ship a :file:`setup.py` file225that declares an entrypoint that points to a click command:226227Example `setup.py`::227Example :file:`setup.py`::228229 from setuptools import setup230231 setup(
4 unmodified lines
236 my-command=mypackage.commands:cli237 ''',238 )239240Inside `mypackage/commands.py` you can then export a Click object::240Inside :file:`mypackage/commands.py` you can then export a Click object::241242 import click243244 @click.command()
6 unmodified lines
modified:docs/conf.py+42 added-36 removed
9 unmodified lines
10#11# All configuration values have a default; values that are commented out12# serve to show the default.13from __future__ import print_function14from datetime import datetime15import os14import sys, os16import sys17import pkg_resources1819# If extensions (or modules to document with autodoc) are in another directory,20# add these directories to sys.path here. If the directory is relative to the21# documentation root, use os.path.abspath to make it absolute, like shown here.19sys.path.append(os.path.abspath('_themes'))20sys.path.append(os.path.abspath('.'))22sys.path.append(os.path.join(os.path.dirname(__file__), '_themes'))23sys.path.append(os.path.dirname(__file__))2425# -- General configuration -----------------------------------------------------2627# If your documentation needs a minimal Sphinx version, state it here.
20 unmodified lines
48master_doc = 'index'4950# General information about the project.51project = u'Flask'49copyright = u'2015, Armin Ronacher'52copyright = u'2010 - {0}, Armin Ronacher'.format(datetime.utcnow().year)5354# The version info for the project you're documenting, acts as replacement for55# |version| and |release|, also used in various other places throughout the56# built documents.54import pkg_resources57try:58 release = pkg_resources.get_distribution('Flask').version59except pkg_resources.DistributionNotFound:60 print('Flask must be installed to build the documentation.')61 print('Install from source using `pip install -e .` in a virtualenv.')62 sys.exit(1)61del pkg_resources6364if 'dev' in release:64 release = release.split('dev')[0] + 'dev'65 release = ''.join(release.partition('dev')[:2])6667version = '.'.join(release.split('.')[:2])6869# The language for content autogenerated by Sphinx. Refer to documentation70# for a list of supported languages.
30 unmodified lines
101# -- Options for HTML output ---------------------------------------------------102103# The theme to use for HTML and HTML Help pages. Major themes that come with104# Sphinx are currently 'default' and 'sphinxdoc'.103html_theme = 'flask'105# html_theme = 'default'106107# Theme options are theme-specific and customize the look and feel of a theme108# further. For a list of options available for each theme, see the109# documentation.108html_theme_options = {109 'touch_icon': 'touch-icon.png'110}110# html_theme_options = {}111112# Add any paths that contain custom themes here, relative to this directory.113html_theme_path = ['_themes']114
10 unmodified lines
125126# The name of an image file (within the static path) to use as favicon of the127# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32128# pixels large.129html_favicon = "flask-favicon.ico"129html_favicon = '_static/flask-favicon.ico'130131# Add any paths that contain custom static files (such as style sheets) here,132# relative to this directory. They are copied after the builtin static files,133# so a file named "default.css" will overwrite the builtin "default.css".
8 unmodified lines
142#html_use_smartypants = True143144# Custom sidebar templates, maps document names to template names.145html_sidebars = {146 'index': ['sidebarintro.html', 'sourcelink.html', 'searchbox.html'],147 '**': ['sidebarlogo.html', 'localtoc.html', 'relations.html',148 'sourcelink.html', 'searchbox.html']146 'index': [147 'sidebarintro.html',148 'sourcelink.html',149 'searchbox.html'150 ],151 '**': [152 'sidebarlogo.html',153 'localtoc.html',154 'relations.html',155 'sourcelink.html',156 'searchbox.html'157 ]158}159160# Additional templates that should be rendered to pages, maps page names to161# template names.
33 unmodified lines
195196# Grouping the document tree into LaTeX files. List of tuples197# (source start file, target name, title, author, documentclass [howto/manual]).198latex_documents = [190 ('latexindex', 'Flask.tex', u'Flask Documentation',191 u'Armin Ronacher', 'manual'),199 ('latexindex', 'Flask.tex', u'Flask Documentation', u'Armin Ronacher', 'manual'),200]201202# Documents to append as an appendix to all manuals.203#latex_appendices = []
1 unmodified line
205# If false, no module index is generated.206latex_use_modindex = False207208latex_elements = {201 'fontpkg': r'\usepackage{mathpazo}',202 'papersize': 'a4paper',203 'pointsize': '12pt',204 'preamble': r'\usepackage{flaskstyle}'209 'fontpkg': r'\usepackage{mathpazo}',210 'papersize': 'a4paper',211 'pointsize': '12pt',212 'preamble': r'\usepackage{flaskstyle}'213}214latex_use_parts = True215216latex_additional_files = ['flaskstyle.sty', 'logo.pdf']
35 unmodified lines
252# The depth of the table of contents in toc.ncx.253#epub_tocdepth = 3254255intersphinx_mapping = {248 'https://docs.python.org/dev': None,249 'http://werkzeug.pocoo.org/docs/': None,250 'http://click.pocoo.org/': None,251 'http://jinja.pocoo.org/docs/': None,252 'http://www.sqlalchemy.org/docs/': None,253 'https://wtforms.readthedocs.io/en/latest/': None,254 'https://pythonhosted.org/blinker/': None256 'python': ('https://docs.python.org/3/', None),257 'werkzeug': ('http://werkzeug.pocoo.org/docs/', None),258 'click': ('http://click.pocoo.org/', None),259 'jinja': ('http://jinja.pocoo.org/docs/', None),260 'sqlalchemy': ('http://docs.sqlalchemy.org/en/latest/', None),261 'wtforms': ('https://wtforms.readthedocs.io/en/latest/', None),262 'blinker': ('https://pythonhosted.org/blinker/', None)263}264257pygments_style = 'flask_theme_support.FlaskyStyle'258259# fall back if theme is not there265try:266 __import__('flask_theme_support')267 pygments_style = 'flask_theme_support.FlaskyStyle'268 html_theme = 'flask'269 html_theme_options = {270 'touch_icon': 'touch-icon.png'271 }262except ImportError as e:272except ImportError:273 print('-' * 74)274 print('Warning: Flask themes unavailable. Building with default theme')275 print('If you want the Flask themes, run this command and build again:')276 print()277 print(' git submodule update --init')278 print('-' * 74)279270 pygments_style = 'tango'271 html_theme = 'default'272 html_theme_options = {}280274281# unwrap decorators282def unwrap_decorators():283 import sphinx.util.inspect as inspect284 import functools
15 unmodified lines
modified:docs/installation.rst+2 added-2 removed
141 unmodified lines
142packages you will need are setuptools and pip - these will let you install143anything else (like virtualenv). Fortunately there are two "bootstrap scripts"144you can run to install either.145146If you don't currently have either, then `get-pip.py` will install both for you147(you won't need to run ez_setup.py).146If you don't currently have either, then :file:`get-pip.py` will install both for you147(you won't need to run :file:`ez_setup.py`).148149`get-pip.py`_150151To install the latest setuptools, you can use its bootstrap file:
25 unmodified lines
modified:docs/quickstart.rst+57 added-61 removed
24 unmodified lines
251. First we imported the :class:`~flask.Flask` class. An instance of this26 class will be our WSGI application.272. Next we create an instance of this class. The first argument is the name of28 the application's module or package. If you are using a single module (as29 in this example), you should use `__name__` because depending on if it's29 in this example), you should use ``__name__`` because depending on if it's30 started as application or imported as module the name will be different31 (``'__main__'`` versus the actual import name). This is needed so that32 Flask knows where to look for templates, static files, and so on. For more33 information have a look at the :class:`~flask.Flask` documentation.
7 unmodified lines
41your application :file:`flask.py` because this would conflict with Flask42itself.4344To run the application you can either use the :command:`flask` command or45python's :option:`-m` switch with Flask. Before you can do that you need45python's ``-m`` switch with Flask. Before you can do that you need46to tell your terminal the application to work with by exporting the47`FLASK_APP` environment variable::47``FLASK_APP`` environment variable::4849 $ export FLASK_APP=hello.py50 $ flask run51 * Running on http://127.0.0.1:5000/5253If you are on Windows you need to use `set` instead of `export`.53If you are on Windows you need to use ``set`` instead of ``export``.5455Alternatively you can use `python -m flask`::55Alternatively you can use :command:`python -m flask`::5657 $ export FLASK_APP=hello.py58 $ python -m flask run59 * Running on http://127.0.0.1:5000/
25 unmodified lines
8586What to do if the Server does not Start87---------------------------------------8889In case the ``python -m flask`` fails or :command:`flask` does not exist,89In case the :command:`python -m flask` fails or :command:`flask` does not exist,90there are multiple reasons this might be the case. First of all you need91to look at the error message.9293Old Version of Flask94````````````````````9596Versions of Flask older than 0.11 use to have different ways to start the97application. In short, the :command:`flask` command did not exist, and98neither did ``python -m flask``. In that case you have two options:98neither did :command:`python -m flask`. In that case you have two options:99either upgrade to newer Flask versions or have a look at the :ref:`server`100docs to see the alternative method for running a server.101102Invalid Import Name103```````````````````104105The :option:`-a` argument to :command:`flask` is the name of the module to105The ``-a`` argument to :command:`flask` is the name of the module to106import. In case that module is incorrectly named you will get an import107error upon start (or if debug is enabled when you navigate to the108application). It will tell you what it tried to import and why it failed.109
12 unmodified lines
122That is not very nice and Flask can do better. If you enable debug123support the server will reload itself on code changes, and it will also124provide you with a helpful debugger if things go wrong.125126To enable debug mode you can export the `FLASK_DEBUG` environment variable126To enable debug mode you can export the ``FLASK_DEBUG`` environment variable127before running the server::128129 $ export FLASK_DEBUG=1130 $ flask run131132(On Windows you need to use `set` instead of `export`).132(On Windows you need to use ``set`` instead of ``export``).133134This does the following things:1351361. it activates the debugger
64 unmodified lines
201202=========== ===============================================203`string` accepts any text without a slash (the default)204`int` accepts integers205`float` like `int` but for floating point values205`float` like ``int`` but for floating point values206`path` like the default but also accepts slashes207`any` matches one of the items provided208`uuid` accepts UUID strings209=========== ===============================================
15 unmodified lines
225 return 'The about page'226227 Though they look rather similar, they differ in their use of the trailing228 slash in the URL *definition*. In the first case, the canonical URL for the229 `projects` endpoint has a trailing slash. In that sense, it is similar to229 ``projects`` endpoint has a trailing slash. In that sense, it is similar to230 a folder on a filesystem. Accessing it without a trailing slash will cause231 Flask to redirect to the canonical URL with the trailing slash.232233 In the second case, however, the URL is defined without a trailing slash,
15 unmodified lines
249build a URL to a specific function you can use the :func:`~flask.url_for`250function. It accepts the name of the function as first argument and a number251of keyword arguments, each corresponding to the variable part of the URL rule.252Unknown variable parts are appended to the URL as query parameters. Here are253some examples:253some examples::254255>>> from flask import Flask, url_for256>>> app = Flask(__name__)257>>> @app.route('/')258... def index(): pass259...260>>> @app.route('/login')261... def login(): pass262...263>>> @app.route('/user/<username>')264... def profile(username): pass265...266>>> with app.test_request_context():267... print url_for('index')268... print url_for('login')269... print url_for('login', next='/')270... print url_for('profile', username='John Doe')271...272/273/login274/login?next=/275/user/John%20Doe255 >>> from flask import Flask, url_for256 >>> app = Flask(__name__)257 >>> @app.route('/')258 ... def index(): pass259 ...260 >>> @app.route('/login')261 ... def login(): pass262 ...263 >>> @app.route('/user/<username>')264 ... def profile(username): pass265 ...266 >>> with app.test_request_context():267 ... print url_for('index')268 ... print url_for('login')269 ... print url_for('login', next='/')270 ... print url_for('profile', username='John Doe')271 ...272 /273 /login274 /login?next=/275 /user/John%20Doe276277(This also uses the :meth:`~flask.Flask.test_request_context` method, explained278below. It tells Flask to behave as though it is handling a request, even279though we are interacting with it through a Python shell. Have a look at the
7 unmodified lines
287 importantly, it allows you to change URLs in one go, without having to288 remember to change URLs all over the place.2892. URL building will handle escaping of special characters and Unicode290 data transparently for you, so you don't have to deal with them.2913. If your application is placed outside the URL root (say, in292 ``/myapplication`` instead of ``/``), :func:`~flask.url_for` will handle2913. If your application is placed outside the URL root - say, in292 ``/myapplication`` instead of ``/`` - :func:`~flask.url_for` will handle293 that properly for you.294295296HTTP Methods297````````````298299HTTP (the protocol web applications are speaking) knows different methods for300accessing URLs. By default, a route only answers to ``GET`` requests, but that301can be changed by providing the `methods` argument to the301can be changed by providing the ``methods`` argument to the302:meth:`~flask.Flask.route` decorator. Here are some examples::303304 from flask import request305
139 unmodified lines
445know how that works, head over to the :ref:`template-inheritance` pattern446documentation. Basically template inheritance makes it possible to keep447certain elements on each page (like header, navigation and footer).448449Automatic escaping is enabled, so if `name` contains HTML it will be escaped449Automatic escaping is enabled, so if ``name`` contains HTML it will be escaped450automatically. If you can trust a variable and you know that it will be451safe HTML (for example because it came from a module that converts wiki452markup to HTML) you can mark it as safe by using the453:class:`~jinja2.Markup` class or by using the ``|safe`` filter in the454template. Head over to the Jinja 2 documentation for more examples.455456Here is a basic introduction to how the :class:`~jinja2.Markup` class works:456Here is a basic introduction to how the :class:`~jinja2.Markup` class works::457458>>> from flask import Markup459>>> Markup('<strong>Hello %s!</strong>') % '<blink>hacker</blink>'460Markup(u'<strong>Hello &lt;blink&gt;hacker&lt;/blink&gt;!</strong>')461>>> Markup.escape('<blink>hacker</blink>')462Markup(u'&lt;blink&gt;hacker&lt;/blink&gt;')463>>> Markup('<em>Marked up</em> &raquo; HTML').striptags()464u'Marked up \xbb HTML'458 >>> from flask import Markup459 >>> Markup('<strong>Hello %s!</strong>') % '<blink>hacker</blink>'460 Markup(u'<strong>Hello &lt;blink&gt;hacker&lt;/blink&gt;!</strong>')461 >>> Markup.escape('<blink>hacker</blink>')462 Markup(u'&lt;blink&gt;hacker&lt;/blink&gt;')463 >>> Markup('<em>Marked up</em> &raquo; HTML').striptags()464 u'Marked up \xbb HTML'465466.. versionchanged:: 0.5467468 Autoescaping is no longer enabled for all templates. The following
70 unmodified lines
539540The request object is documented in the API section and we will not cover541it here in detail (see :class:`~flask.request`). Here is a broad overview of542some of the most common operations. First of all you have to import it from543the `flask` module::543the ``flask`` module::544545 from flask import request546547The current request method is available by using the
14 unmodified lines
562 # the code below is executed if the request method563 # was GET or the credentials were invalid564 return render_template('login.html', error=error)565566What happens if the key does not exist in the `form` attribute? In that566What happens if the key does not exist in the ``form`` attribute? In that567case a special :exc:`KeyError` is raised. You can catch it like a568standard :exc:`KeyError` but if you don't do that, a HTTP 400 Bad Request569error page is shown instead. So for many situations you don't have to570deal with that problem.
153 unmodified lines
724 default parameters.7253. If a tuple is returned the items in the tuple can provide extra726 information. Such tuples have to be in the form ``(response, status,727 headers)`` or ``(response, headers)`` where at least one item has728 to be in the tuple. The `status` value will override the status code729 and `headers` can be a list or dictionary of additional header values.728 to be in the tuple. The ``status`` value will override the status code729 and ``headers`` can be a list or dictionary of additional header values.7304. If none of that works, Flask will assume the return value is a731 valid WSGI application and convert that into a response object.732733If you want to get hold of the resulting response object inside the view734you can use the :func:`~flask.make_response` function.735736Imagine you have a view like this:736Imagine you have a view like this::737738.. sourcecode:: python739738 @app.errorhandler(404)739 def not_found(error):740 return render_template('error.html'), 404741742You just need to wrap the return expression with743:func:`~flask.make_response` and get the response object to modify it, then746return it:744return it::745748.. sourcecode:: python749746 @app.errorhandler(404)747 def not_found(error):748 resp = make_response(render_template('error.html'), 404)749 resp.headers['X-Something'] = 'A value'
52 unmodified lines
802803 The problem with random is that it's hard to judge what is truly random. And804 a secret key should be as random as possible. Your operating system805 has ways to generate pretty random stuff based on a cryptographic810 random generator which can be used to get such a key:806 random generator which can be used to get such a key::807812 >>> import os813 >>> os.urandom(24)814 '\xfd{H\xe5<\x95\xf9\xe3\x96.5\xd1\x01O<!\xd5\xa2\xa0\x9fR"\xa1\xa8'808 >>> import os809 >>> os.urandom(24)810 '\xfd{H\xe5<\x95\xf9\xe3\x96.5\xd1\x01O<!\xd5\xa2\xa0\x9fR"\xa1\xa8'811816 Just take that thing and copy/paste it into your code and you're done.812 Just take that thing and copy/paste it into your code and you're done.813814A note on cookie-based sessions: Flask will take the values you put into the815session object and serialize them into a cookie. If you are finding some816values do not persist across requests, cookies are indeed enabled, and you are
74 unmodified lines
modified:docs/upgrading.rst+9 added-9 removed
13 unmodified lines
14release to release and how you can change your code to have a painless15updating experience.1617Use the :command:`pip` command to upgrade your existing Flask installation by18providing the :option:`--upgrade` parameter::18providing the ``--upgrade`` parameter::1920 $ pip install --upgrade Flask2122.. _upgrading-to-10:
6 unmodified lines
29to the release we decided to push out a 0.11 release first with some30changes removed to make the transition easier. If you have been tracking31the master branch which was 1.0 you might see some unexpected changes.3233In case you did track the master branch you will notice that `flask --app`33In case you did track the master branch you will notice that :command:`flask --app`34is removed now. You need to use the environment variable to specify an35application.3637Debugging
29 unmodified lines
6768The :func:`~flask.templating.render_template_string` function has changed to69autoescape template variables by default. This better matches the behavior70of :func:`~flask.templating.render_template`.71 7172Extension imports73`````````````````7475Extension imports of the form ``flask.ext.foo`` are deprecated, you should use
56 unmodified lines
132Version 0.8133-----------134135Flask introduced a new session interface system. We also noticed that136there was a naming collision between `flask.session` the module that136there was a naming collision between ``flask.session`` the module that137implements sessions and :data:`flask.session` which is the global session138object. With that introduction we moved the implementation details for139the session system into a new module called :mod:`flask.sessions`. If you140used the previously undocumented session support we urge you to upgrade.
57 unmodified lines
198Please note that deprecation warnings are disabled by default starting199with Python 2.7. In order to see the deprecation warnings that might be200emitted you have to enabled them with the :mod:`warnings` module.201202If you are working with windows and you lack the `patch` command line202If you are working with windows and you lack the ``patch`` command line203utility you can get it as part of various Unix runtime environments for204windows including cygwin, msysgit or ming32. Also source control systems205like svn, hg or git have builtin support for applying unified diffs as206generated by the tool. Check the manual of your version control system
108 unmodified lines
315 that name but it might fail as this information could change at316 runtime.317- Blueprints have an inverse behavior for :meth:`url_for`. Previously318 ``.foo`` told :meth:`url_for` that it should look for the endpoint319 `foo` on the application. Now it means “relative to current module”.319 ``foo`` on the application. Now it means “relative to current module”.320 The script will inverse all calls to :meth:`url_for` automatically for321 you. It will do this in a very eager way so you might end up with322 some unnecessary leading dots in your code if you're not using323 modules.
9 unmodified lines
333 This means that you need to add another subfolder with the blueprint's334 name into that folder if you want :file:`blueprintname/template.html` as335 the template name.336337If you continue to use the `Module` object which is deprecated, Flask will337If you continue to use the ``Module`` object which is deprecated, Flask will338restore the previous behavior as good as possible. However we strongly339recommend upgrading to the new blueprints as they provide a lot of useful340improvement such as the ability to attach a blueprint multiple times,341blueprint specific error handlers and a lot more.
11 unmodified lines
353change the order.354355Another change that breaks backwards compatibility is that context356processors will no longer override values passed directly to the template357rendering function. If for example `request` is as variable passed357rendering function. If for example ``request`` is as variable passed358directly to the template, the default context processor will not override359it with the current request object. This makes it easier to extend360context processors later to inject additional variables without breaking361existing template not expecting them.
17 unmodified lines
379 functionality might come back in future releases if there is demand380 for this feature. Removing support for this makes the Flask internal381 code easier to understand and fixes a couple of small issues that make382 debugging harder than necessary.383- The `create_jinja_loader` function is gone. If you want to customize383- The ``create_jinja_loader`` function is gone. If you want to customize384 the Jinja loader now, use the385 :meth:`~flask.Flask.create_jinja_environment` method instead.386387Version 0.4
47 unmodified lines
modified:flask/cli.py+2 added-2 removed
284 unmodified lines
285 For information as of why this is useful see :ref:`custom-scripts`.286287 :param add_default_commands: if this is True then the default run and288 shell commands wil be added.289 :param add_version_option: adds the :option:`--version` option.289 :param add_version_option: adds the ``--version`` option.290 :param create_app: an optional callback that is passed the script info291 and returns the loaded app.292 """293
115 unmodified lines
409 eager_loading = not reload410411 app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)412413 # Extra startup messages. This depends a but on Werkzeug internals to413 # Extra startup messages. This depends a bit on Werkzeug internals to414 # not double execute when the reloader kicks in.415 if os.environ.get('WERKZEUG_RUN_MAIN') != 'true':416 # If we have an import path we can print it out now which can help417 # people understand what's being served. If we do not have an
89 unmodified lines