Added lazyloading pattern and explicit chapter links in tutorial.
This fixes #49.
This commit is contained in:
parent
6c095deda5
commit
9d19b77acf
15 changed files with 147 additions and 3 deletions
|
|
@ -1,3 +1,5 @@
|
|||
.. _tutorial-css:
|
||||
|
||||
Step 7: Adding Style
|
||||
====================
|
||||
|
||||
|
|
@ -25,3 +27,5 @@ folder we created before:
|
|||
.flash { background: #CEE5F5; padding: 0.5em;
|
||||
border: 1px solid #AACBE2; }
|
||||
.error { background: #F0D6D6; padding: 0.5em; }
|
||||
|
||||
Continue with :ref:`tutorial-testing`.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
.. _tutorial-dbcon:
|
||||
|
||||
Step 4: Request Database Connections
|
||||
------------------------------------
|
||||
|
||||
|
|
@ -31,3 +33,5 @@ request only and is available from within each function. Never store such
|
|||
things on other objects because this would not work with threaded
|
||||
environments. That special :data:`~flask.g` object does some magic behind
|
||||
the scenes to ensure it does the right thing.
|
||||
|
||||
Continue to :ref:`tutorial-views`.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
.. _tutorial-dbinit:
|
||||
|
||||
Step 3: Creating The Database
|
||||
=============================
|
||||
|
||||
|
|
@ -61,3 +63,5 @@ importing and calling that function::
|
|||
If you get an exception later that a table cannot be found check that
|
||||
you did call the `init_db` function and that your table names are
|
||||
correct (singular vs. plural for example).
|
||||
|
||||
Continue with :ref:`tutorial-dbcon`
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
.. _tutorial-folders:
|
||||
|
||||
Step 0: Creating The Folders
|
||||
============================
|
||||
|
||||
|
|
@ -16,4 +18,6 @@ This is the place where css and javascript files go. Inside the
|
|||
`templates` folder Flask will look for `Jinja2`_ templates. Drop all the
|
||||
templates there.
|
||||
|
||||
Continue with :ref:`tutorial-schema`.
|
||||
|
||||
.. _Jinja2: http://jinja.pocoo.org/2/
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
.. _tutorial-introduction:
|
||||
|
||||
Introducing Flaskr
|
||||
==================
|
||||
|
||||
|
|
@ -26,4 +28,6 @@ Here a screenshot from the final application:
|
|||
:class: screenshot
|
||||
:alt: screenshot of the final application
|
||||
|
||||
Continue with :ref:`tutorial-folders`.
|
||||
|
||||
.. _SQLAlchemy: http://www.sqlalchemy.org/
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
.. _tutorial-schema:
|
||||
|
||||
Step 1: Database Schema
|
||||
=======================
|
||||
|
||||
|
|
@ -19,3 +21,5 @@ This schema consists of a single table called `entries` and each row in
|
|||
this table has an `id`, a `title` and a `text`. The `id` is an
|
||||
automatically incrementing integer and a primary key, the other two are
|
||||
strings that must not be null.
|
||||
|
||||
Continue with :ref:`tutorial-setup`.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
.. _tutorial-setup:
|
||||
|
||||
Step 2: Application Setup Code
|
||||
==============================
|
||||
|
||||
|
|
@ -62,3 +64,5 @@ focus on that a little later. First we should get the database working.
|
|||
Want your server to be publically available? Check out the
|
||||
:ref:`externally visible server <public-server>` section for more
|
||||
information.
|
||||
|
||||
Continue with :ref:`tutorial-dbinit`.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
.. _tutorial-templates:
|
||||
|
||||
Step 6: The Templates
|
||||
=====================
|
||||
|
||||
|
|
@ -105,3 +107,5 @@ the user to login:
|
|||
</dl>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
Continue with :ref:`tutorial-css`.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
.. _tutorial-testing:
|
||||
|
||||
Bonus: Testing the Application
|
||||
===============================
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
.. _tutorial-views:
|
||||
|
||||
Step 5: The View Functions
|
||||
==========================
|
||||
|
||||
|
|
@ -85,3 +87,5 @@ that case if the user was logged in.
|
|||
session.pop('logged_in', None)
|
||||
flash('You were logged out')
|
||||
return redirect(url_for('show_entries'))
|
||||
|
||||
Continue with :ref:`tutorial-templates`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue