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
Provenance
- Commit
1928f28- Tree
0ff687f- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
0e46070
8 files changed+133 added−133 removed
modified:docs/patterns/distribute.rst+12 added-14 removed
37 unmodified lines38 39 Basic Setup Script40 ------------------41 42-Because you have Flask running, you have setuptools available on your system anyways.43-Flask already depends upon setuptools. If you do not, fear not, there is a44-script to install it for you: `ez_setup.py`_. Just download and45-run with your Python interpreter.42+Because you have Flask installed, you have setuptools available on your system.43+Flask already depends upon setuptools.44 45 Standard disclaimer applies: :ref:`you better use a virtualenv46 <virtualenv>`.47 16 unmodified lines64 )65 66 Please keep in mind that you have to list subpackages explicitly. If you67 want setuptools to lookup the packages for you automatically, you can use70-the `find_packages` function::68+the ``find_packages`` function::69 70 from setuptools import setup, find_packages71 72 setup(73 ...74 packages=find_packages()75 )76 79-Most 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` file77+Most 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` file80 and install all the entries that match as package data. We will use this81 to 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 to83 force or prevent zip Archive creation. In general you probably don't want84 your packages to be installed as zip files because some tools do not85 support them and they make debugging a lot harder.86 33 unmodified lines120 recursive-include yourapplication/static *121 122 Don't forget that even if you enlist them in your :file:`MANIFEST.in` file, they123 won't be installed for you unless you set the `include_package_data`126-parameter of the `setup` function to ``True``!124+parameter of the ``setup`` function to ``True``!125 126 127 Declaring Dependencies128 ----------------------129 132-Dependencies are declared in the `install_requires` parameter as a list.130+Dependencies are declared in the ``install_requires`` parameter as a list.131 Each item in that list is the name of a package that should be pulled from132 PyPI on installation. By default it will always use the most recent133 version, but you can also provide minimum and maximum version134 requirements. Here some examples::21 unmodified lines156 Installing / Developing157 -----------------------158 159 To 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 your161 application into the virtualenv's site-packages folder and also download162 and install all dependencies::163 164 $ python setup.py install165 166 If you are developing on the package and also want the requirements to be169-installed, you can use the `develop` command instead::167+installed, you can use the ``develop`` command instead::168 169 $ python setup.py develop170 171 This has the advantage of just installing a link to the site-packages172 folder instead of copying the data over. You can then continue to work on175-the code without having to run `install` again after each change.173+the code without having to run ``install`` again after each change.174 175 176 .. _pip: https://pypi.python.org/pypi/pip177 .. _Setuptools: https://pythonhosted.org/setuptoolsmodified:docs/appcontext.rst+3 added-3 removed
72 unmodified lines73 The application context is also used by the :func:`~flask.url_for`74 function in case a ``SERVER_NAME`` was configured. This allows you to75 generate URLs even in the absence of a request.76 77-If no request context has been pushed and an application context has 78-not been explicitly set, a ``RuntimeError`` will be raised.79-::77+If no request context has been pushed and an application context has78+not been explicitly set, a ``RuntimeError`` will be raised. ::79+80 RuntimeError: Working outside of application context.81 82 Locality of the Context83 -----------------------55 unmodified linesmodified:docs/cli.rst+6 added-6 removed
30 unmodified lines31 Python module that contains a Flask application.32 33 In that imported file the name of the app needs to be called ``app`` or34 optionally 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 in36 the :file:`mymodule.py` file.37 38 Given a :file:`hello.py` file with the application in it named ``app``39 this is how it can be run.177 unmodified lines217 218 CLI Plugins219 -----------220 221-Flask extensions can always patch the `Flask.cli` instance with more221+Flask extensions can always patch the :attr:`Flask.cli` instance with more222 commands if they want. However there is a second way to add CLI plugins223-to Flask which is through `setuptools`. If you make a Python package that224-should export a Flask command line plugin you can ship a `setup.py` file223+to Flask which is through ``setuptools``. If you make a Python package that224+should export a Flask command line plugin you can ship a :file:`setup.py` file225 that declares an entrypoint that points to a click command:226 227-Example `setup.py`::227+Example :file:`setup.py`::228 229 from setuptools import setup230 231 setup(4 unmodified lines236 my-command=mypackage.commands:cli237 ''',238 )239 240-Inside `mypackage/commands.py` you can then export a Click object::240+Inside :file:`mypackage/commands.py` you can then export a Click object::241 242 import click243 244 @click.command()6 unmodified linesmodified:docs/conf.py+42 added-36 removed
9 unmodified lines10 #11 # All configuration values have a default; values that are commented out12 # serve to show the default.13 from __future__ import print_function14+from datetime import datetime15+import os14-import sys, os16+import sys17+import pkg_resources18 19 # 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.19-sys.path.append(os.path.abspath('_themes'))20-sys.path.append(os.path.abspath('.'))22+sys.path.append(os.path.join(os.path.dirname(__file__), '_themes'))23+sys.path.append(os.path.dirname(__file__))24 25 # -- General configuration -----------------------------------------------------26 27 # If your documentation needs a minimal Sphinx version, state it here.20 unmodified lines48 master_doc = 'index'49 50 # General information about the project.51 project = u'Flask'49-copyright = u'2015, Armin Ronacher'52+copyright = u'2010 - {0}, Armin Ronacher'.format(datetime.utcnow().year)53 54 # 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.54-import pkg_resources57 try:58 release = pkg_resources.get_distribution('Flask').version59 except 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)61-del pkg_resources63 64 if 'dev' in release:64- release = release.split('dev')[0] + 'dev'65+ release = ''.join(release.partition('dev')[:2])66+67 version = '.'.join(release.split('.')[:2])68 69 # The language for content autogenerated by Sphinx. Refer to documentation70 # for a list of supported languages.30 unmodified lines101 # -- Options for HTML output ---------------------------------------------------102 103 # The theme to use for HTML and HTML Help pages. Major themes that come with104 # Sphinx are currently 'default' and 'sphinxdoc'.103-html_theme = 'flask'105+# html_theme = 'default'106 107 # 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.108-html_theme_options = {109- 'touch_icon': 'touch-icon.png'110-}110+# html_theme_options = {}111 112 # Add any paths that contain custom themes here, relative to this directory.113 html_theme_path = ['_themes']114 10 unmodified lines125 126 # 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.129-html_favicon = "flask-favicon.ico"129+html_favicon = '_static/flask-favicon.ico'130 131 # 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 lines142 #html_use_smartypants = True143 144 # Custom sidebar templates, maps document names to template names.145 html_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 }159 160 # Additional templates that should be rendered to pages, maps page names to161 # template names.33 unmodified lines195 196 # Grouping the document tree into LaTeX files. List of tuples197 # (source start file, target name, title, author, documentclass [howto/manual]).198 latex_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 ]201 202 # Documents to append as an appendix to all manuals.203 #latex_appendices = []1 unmodified line205 # If false, no module index is generated.206 latex_use_modindex = False207 208 latex_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 }214 latex_use_parts = True215 216 latex_additional_files = ['flaskstyle.sty', 'logo.pdf']35 unmodified lines252 # The depth of the table of contents in toc.ncx.253 #epub_tocdepth = 3254 255 intersphinx_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 }264 257-pygments_style = 'flask_theme_support.FlaskyStyle'258-259-# fall back if theme is not there265 try: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+ }262-except ImportError as e:272+except 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)279 270- pygments_style = 'tango'271- html_theme = 'default'272- html_theme_options = {}280 274-281 # unwrap decorators282 def unwrap_decorators():283 import sphinx.util.inspect as inspect284 import functools15 unmodified linesmodified:docs/installation.rst+2 added-2 removed
141 unmodified lines142 packages you will need are setuptools and pip - these will let you install143 anything else (like virtualenv). Fortunately there are two "bootstrap scripts"144 you can run to install either.145 146-If you don't currently have either, then `get-pip.py` will install both for you147-(you won't need to run ez_setup.py).146+If 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`).148 149 `get-pip.py`_150 151 To install the latest setuptools, you can use its bootstrap file:25 unmodified linesmodified:docs/quickstart.rst+57 added-61 removed
24 unmodified lines25 1. First we imported the :class:`~flask.Flask` class. An instance of this26 class will be our WSGI application.27 2. 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 lines41 your application :file:`flask.py` because this would conflict with Flask42 itself.43 44 To run the application you can either use the :command:`flask` command or45-python's :option:`-m` switch with Flask. Before you can do that you need45+python's ``-m`` switch with Flask. Before you can do that you need46 to tell your terminal the application to work with by exporting the47-`FLASK_APP` environment variable::47+``FLASK_APP`` environment variable::48 49 $ export FLASK_APP=hello.py50 $ flask run51 * Running on http://127.0.0.1:5000/52 53-If you are on Windows you need to use `set` instead of `export`.53+If you are on Windows you need to use ``set`` instead of ``export``.54 55-Alternatively you can use `python -m flask`::55+Alternatively you can use :command:`python -m flask`::56 57 $ export FLASK_APP=hello.py58 $ python -m flask run59 * Running on http://127.0.0.1:5000/25 unmodified lines85 86 What to do if the Server does not Start87 ---------------------------------------88 89-In case the ``python -m flask`` fails or :command:`flask` does not exist,89+In case the :command:`python -m flask` fails or :command:`flask` does not exist,90 there are multiple reasons this might be the case. First of all you need91 to look at the error message.92 93 Old Version of Flask94 ````````````````````95 96 Versions of Flask older than 0.11 use to have different ways to start the97 application. In short, the :command:`flask` command did not exist, and98-neither did ``python -m flask``. In that case you have two options:98+neither did :command:`python -m flask`. In that case you have two options:99 either upgrade to newer Flask versions or have a look at the :ref:`server`100 docs to see the alternative method for running a server.101 102 Invalid Import Name103 ```````````````````104 105-The :option:`-a` argument to :command:`flask` is the name of the module to105+The ``-a`` argument to :command:`flask` is the name of the module to106 import. In case that module is incorrectly named you will get an import107 error upon start (or if debug is enabled when you navigate to the108 application). It will tell you what it tried to import and why it failed.109 12 unmodified lines122 That is not very nice and Flask can do better. If you enable debug123 support the server will reload itself on code changes, and it will also124 provide you with a helpful debugger if things go wrong.125 126-To enable debug mode you can export the `FLASK_DEBUG` environment variable126+To enable debug mode you can export the ``FLASK_DEBUG`` environment variable127 before running the server::128 129 $ export FLASK_DEBUG=1130 $ flask run131 132-(On Windows you need to use `set` instead of `export`).132+(On Windows you need to use ``set`` instead of ``export``).133 134 This does the following things:135 136 1. it activates the debugger64 unmodified lines201 202 =========== ===============================================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 lines225 return 'The about page'226 227 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.232 233 In the second case, however, the URL is defined without a trailing slash,15 unmodified lines249 build a URL to a specific function you can use the :func:`~flask.url_for`250 function. It accepts the name of the function as first argument and a number251 of keyword arguments, each corresponding to the variable part of the URL rule.252 Unknown variable parts are appended to the URL as query parameters. Here are253-some examples:253+some examples::254 255->>> 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%20Doe276 277 (This also uses the :meth:`~flask.Flask.test_request_context` method, explained278 below. It tells Flask to behave as though it is handling a request, even279 though we are interacting with it through a Python shell. Have a look at the7 unmodified lines287 importantly, it allows you to change URLs in one go, without having to288 remember to change URLs all over the place.289 2. URL building will handle escaping of special characters and Unicode290 data transparently for you, so you don't have to deal with them.291-3. If your application is placed outside the URL root (say, in292- ``/myapplication`` instead of ``/``), :func:`~flask.url_for` will handle291+3. If your application is placed outside the URL root - say, in292+ ``/myapplication`` instead of ``/`` - :func:`~flask.url_for` will handle293 that properly for you.294 295 296 HTTP Methods297 ````````````298 299 HTTP (the protocol web applications are speaking) knows different methods for300 accessing URLs. By default, a route only answers to ``GET`` requests, but that301-can be changed by providing the `methods` argument to the301+can be changed by providing the ``methods`` argument to the302 :meth:`~flask.Flask.route` decorator. Here are some examples::303 304 from flask import request305 139 unmodified lines445 know how that works, head over to the :ref:`template-inheritance` pattern446 documentation. Basically template inheritance makes it possible to keep447 certain elements on each page (like header, navigation and footer).448 449-Automatic escaping is enabled, so if `name` contains HTML it will be escaped449+Automatic escaping is enabled, so if ``name`` contains HTML it will be escaped450 automatically. If you can trust a variable and you know that it will be451 safe HTML (for example because it came from a module that converts wiki452 markup to HTML) you can mark it as safe by using the453 :class:`~jinja2.Markup` class or by using the ``|safe`` filter in the454 template. Head over to the Jinja 2 documentation for more examples.455 456-Here is a basic introduction to how the :class:`~jinja2.Markup` class works:456+Here is a basic introduction to how the :class:`~jinja2.Markup` class works::457 458->>> from flask import Markup459->>> Markup('<strong>Hello %s!</strong>') % '<blink>hacker</blink>'460-Markup(u'<strong>Hello <blink>hacker</blink>!</strong>')461->>> Markup.escape('<blink>hacker</blink>')462-Markup(u'<blink>hacker</blink>')463->>> Markup('<em>Marked up</em> » HTML').striptags()464-u'Marked up \xbb HTML'458+ >>> from flask import Markup459+ >>> Markup('<strong>Hello %s!</strong>') % '<blink>hacker</blink>'460+ Markup(u'<strong>Hello <blink>hacker</blink>!</strong>')461+ >>> Markup.escape('<blink>hacker</blink>')462+ Markup(u'<blink>hacker</blink>')463+ >>> Markup('<em>Marked up</em> » HTML').striptags()464+ u'Marked up \xbb HTML'465 466 .. versionchanged:: 0.5467 468 Autoescaping is no longer enabled for all templates. The following70 unmodified lines539 540 The request object is documented in the API section and we will not cover541 it here in detail (see :class:`~flask.request`). Here is a broad overview of542 some of the most common operations. First of all you have to import it from543-the `flask` module::543+the ``flask`` module::544 545 from flask import request546 547 The current request method is available by using the14 unmodified lines562 # the code below is executed if the request method563 # was GET or the credentials were invalid564 return render_template('login.html', error=error)565 566-What happens if the key does not exist in the `form` attribute? In that566+What happens if the key does not exist in the ``form`` attribute? In that567 case a special :exc:`KeyError` is raised. You can catch it like a568 standard :exc:`KeyError` but if you don't do that, a HTTP 400 Bad Request569 error page is shown instead. So for many situations you don't have to570 deal with that problem.153 unmodified lines724 default parameters.725 3. 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.730 4. If none of that works, Flask will assume the return value is a731 valid WSGI application and convert that into a response object.732 733 If you want to get hold of the resulting response object inside the view734 you can use the :func:`~flask.make_response` function.735 736-Imagine you have a view like this:736+Imagine you have a view like this::737 738-.. sourcecode:: python739-738 @app.errorhandler(404)739 def not_found(error):740 return render_template('error.html'), 404741 742 You just need to wrap the return expression with743 :func:`~flask.make_response` and get the response object to modify it, then746-return it:744+return it::745 748-.. sourcecode:: python749-746 @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 lines802 803 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::807 812- >>> 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'811 816- 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.813 814 A note on cookie-based sessions: Flask will take the values you put into the815 session object and serialize them into a cookie. If you are finding some816 values do not persist across requests, cookies are indeed enabled, and you are74 unmodified linesmodified:docs/upgrading.rst+9 added-9 removed
13 unmodified lines14 release to release and how you can change your code to have a painless15 updating experience.16 17 Use the :command:`pip` command to upgrade your existing Flask installation by18-providing the :option:`--upgrade` parameter::18+providing the ``--upgrade`` parameter::19 20 $ pip install --upgrade Flask21 22 .. _upgrading-to-10:6 unmodified lines29 to the release we decided to push out a 0.11 release first with some30 changes removed to make the transition easier. If you have been tracking31 the master branch which was 1.0 you might see some unexpected changes.32 33-In case you did track the master branch you will notice that `flask --app`33+In case you did track the master branch you will notice that :command:`flask --app`34 is removed now. You need to use the environment variable to specify an35 application.36 37 Debugging29 unmodified lines67 68 The :func:`~flask.templating.render_template_string` function has changed to69 autoescape template variables by default. This better matches the behavior70 of :func:`~flask.templating.render_template`.71- 71+72 Extension imports73 `````````````````74 75 Extension imports of the form ``flask.ext.foo`` are deprecated, you should use56 unmodified lines132 Version 0.8133 -----------134 135 Flask introduced a new session interface system. We also noticed that136-there was a naming collision between `flask.session` the module that136+there was a naming collision between ``flask.session`` the module that137 implements sessions and :data:`flask.session` which is the global session138 object. With that introduction we moved the implementation details for139 the session system into a new module called :mod:`flask.sessions`. If you140 used the previously undocumented session support we urge you to upgrade.57 unmodified lines198 Please note that deprecation warnings are disabled by default starting199 with Python 2.7. In order to see the deprecation warnings that might be200 emitted you have to enabled them with the :mod:`warnings` module.201 202-If you are working with windows and you lack the `patch` command line202+If you are working with windows and you lack the ``patch`` command line203 utility you can get it as part of various Unix runtime environments for204 windows including cygwin, msysgit or ming32. Also source control systems205 like svn, hg or git have builtin support for applying unified diffs as206 generated by the tool. Check the manual of your version control system108 unmodified lines315 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 lines333 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.336 337-If you continue to use the `Module` object which is deprecated, Flask will337+If you continue to use the ``Module`` object which is deprecated, Flask will338 restore the previous behavior as good as possible. However we strongly339 recommend upgrading to the new blueprints as they provide a lot of useful340 improvement such as the ability to attach a blueprint multiple times,341 blueprint specific error handlers and a lot more.11 unmodified lines353 change the order.354 355 Another change that breaks backwards compatibility is that context356 processors will no longer override values passed directly to the template357-rendering function. If for example `request` is as variable passed357+rendering function. If for example ``request`` is as variable passed358 directly to the template, the default context processor will not override359 it with the current request object. This makes it easier to extend360 context processors later to inject additional variables without breaking361 existing template not expecting them.17 unmodified lines379 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.386 387 Version 0.447 unmodified linesmodified:flask/cli.py+2 added-2 removed
284 unmodified lines285 For information as of why this is useful see :ref:`custom-scripts`.286 287 :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 lines409 eager_loading = not reload410 411 app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)412 413- # 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 an89 unmodified lines