forked from orbit-oss/flask
rewrite tutorial docs and example
This commit is contained in:
parent
16d83d6bb4
commit
c3dd7b8e4c
103 changed files with 3327 additions and 2224 deletions
|
|
@ -162,7 +162,5 @@ explanation of the little bit of code above:
|
|||
argument. Note that we can use the `$SCRIPT_ROOT` variable here that
|
||||
we set earlier.
|
||||
|
||||
If you don't get the whole picture, download the `sourcecode
|
||||
for this example
|
||||
<https://github.com/pallets/flask/tree/master/examples/jqueryexample>`_
|
||||
from GitHub.
|
||||
If you don't get the whole picture, download the :gh:`sourcecode
|
||||
for this example <examples/jqueryexample>`.
|
||||
|
|
|
|||
|
|
@ -17,9 +17,8 @@ this::
|
|||
login.html
|
||||
...
|
||||
|
||||
If you find yourself stuck on something, feel free
|
||||
to take a look at the source code for this example.
|
||||
You'll find `the full src for this example here`_.
|
||||
The :ref:`tutorial <tutorial>` is structured this way, see the
|
||||
:gh:`example code <examples/tutorial>`.
|
||||
|
||||
Simple Packages
|
||||
---------------
|
||||
|
|
@ -59,21 +58,21 @@ a big problem, just add a new file called :file:`setup.py` next to the inner
|
|||
],
|
||||
)
|
||||
|
||||
In order to run the application you need to export an environment variable
|
||||
that tells Flask where to find the application instance::
|
||||
In order to run the application you need to export an environment variable
|
||||
that tells Flask where to find the application instance::
|
||||
|
||||
export FLASK_APP=yourapplication
|
||||
|
||||
If you are outside of the project directory make sure to provide the exact
|
||||
If you are outside of the project directory make sure to provide the exact
|
||||
path to your application directory. Similarly you can turn on the
|
||||
development features like this::
|
||||
|
||||
export FLASK_ENV=development
|
||||
|
||||
In order to install and run the application you need to issue the following
|
||||
In order to install and run the application you need to issue the following
|
||||
commands::
|
||||
|
||||
pip install -e .
|
||||
pip install -e .
|
||||
flask run
|
||||
|
||||
What did we gain from this? Now we can restructure the application a bit
|
||||
|
|
@ -134,7 +133,6 @@ You should then end up with something like that::
|
|||
|
||||
|
||||
.. _working-with-modules:
|
||||
.. _the full src for this example here: https://github.com/pallets/flask/tree/master/examples/patterns/largerapp
|
||||
|
||||
Working with Blueprints
|
||||
-----------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue