Skip to content
Myr

Merge pull request #683 from alexcouper/master

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

Tiny changes to docs

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 8a968a9, 1be1329 · Browse files · 2 files+17 added−17 removed
This commit

State

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

Diff stats

2 files+17 added−17 removed

  • other:+17 added−17 removed

2 files+17 added−17 removed

modified:docs/patterns/templateinheritance.rst+9 added-8 removed
26 unmodified lines
27 <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">28 <title>{% block title %}{% endblock %} - My Webpage</title>29 {% endblock %}30 </head>31 <body>32 <div id="content">{% block content %}{% endblock %}</div>33 <div id="footer">34 {% block footer %}35 &copy; Copyright 2010 by <a href="http://domain.invalid/">you</a>.36 {% endblock %}37 </div>38 </body>31 <body>32 <div id="content">{% block content %}{% endblock %}</div>33 <div id="footer">34 {% block footer %}35 &copy; Copyright 2010 by <a href="http://domain.invalid/">you</a>.36 {% endblock %}37 </div>38 </body>39 </html>4041In this example, the ``{% block %}`` tags define four blocks that child templates42can fill in. All the `block` tag does is tell the template engine that a43child template may override those portions of the template.
27 unmodified lines
modified:docs/quickstart.rst+8 added-9 removed
36 unmodified lines
3738So what did that code do?39401. First we imported the :class:`~flask.Flask` class. An instance of this41 class will be our WSGI application. The first argument is the name of42 the application's module. If you are using a single module (as in this43 example), you should use `__name__` because depending on if it's started as44 application or imported as module the name will be different (``'__main__'``45 versus the actual import name). For more information, have a look at the46 :class:`~flask.Flask` documentation.472. Next we create an instance of this class. We pass it the name of the module48 or package. This is needed so that Flask knows where to look for templates,49 static files, and so on.41 class will be our WSGI application. 422. Next we create an instance of this class. The first argument is the name of43 the application's module or package. If you are using a single module (as44 in this example), you should use `__name__` because depending on if it's45 started as application or imported as module the name will be different46 (``'__main__'`` versus the actual import name). This is needed so that47 Flask knows where to look for templates, static files, and so on. For more48 information have a look at the :class:`~flask.Flask` documentation.493. We then use the :meth:`~flask.Flask.route` decorator to tell Flask what URL50 should trigger our function.514. The function is given a name which is also used to generate URLs for that52 particular function, and returns the message we want to display in the
800 unmodified lines