docs: :file:app.py, :file:yourapp/templates

This commit is contained in:
defuz 2014-11-05 06:45:22 +03:00
parent 3fa4fd0908
commit a8f570cc62
32 changed files with 93 additions and 93 deletions

View file

@ -71,12 +71,12 @@ class Flask(_PackageBoundObject):
The name of the package is used to resolve resources from inside the
package or the folder the module is contained in depending on if the
package parameter resolves to an actual python package (a folder with
an `__init__.py` file inside) or a standard module (just a `.py` file).
an :file:`__init__.py` file inside) or a standard module (just a `.py` file).
For more information about resource loading, see :func:`open_resource`.
Usually you create a :class:`Flask` instance in your main module or
in the `__init__.py` file of your package like this::
in the :file:`__init__.py` file of your package like this::
from flask import Flask
app = Flask(__name__)
@ -93,7 +93,7 @@ class Flask(_PackageBoundObject):
using a package, it's usually recommended to hardcode the name of
your package there.
For example if your application is defined in `yourapplication/app.py`
For example if your application is defined in :file:`yourapplication/app.py`
you should create it with one of the two versions below::
app = Flask('yourapplication')

View file

@ -323,7 +323,7 @@ def url_for(endpoint, **values):
def get_template_attribute(template_name, attribute):
"""Loads a macro (or variable) a template exports. This can be used to
invoke a macro from within Python code. If you for example have a
template named `_cider.html` with the following contents:
template named :file:`_cider.html` with the following contents:
.. sourcecode:: html+jinja