Skip to content
Myr

README.rst

This file

Path

examples/tutorial/README.rst

77 lines · 1.4 KiB

Last changed by

Merge pull request #3427 from greyli/update-old-linksDavid Lordbefore adoption25a5d30

History of this file

Take it

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

lines 1–5why, one step back
1Flaskr
2======34The basic blog app built in the Flask `tutorial`_.5

Merge pull request #3427 from greyli/update-old-linksDavid Lordbefore adoption25a5d30

line 6why, one step back
6.. _tutorial: https://flask.palletsprojects.com/tutorial/

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

lines 7–16why, one step back
7
89Install10-------1112**Be sure to use the same version of the code as the version of the docs13you're reading.** You probably want the latest tagged version, but the14default Git version is the master branch. ::1516 # clone the repository

Add prefix for all commands in documentation (#2877)Grey Libefore adoption21b0aa6

lines 17–18why, one step back
17 $ git clone https://github.com/pallets/flask
18 $ cd flask

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

line 19why, one step back
19 # checkout the correct version

Add prefix for all commands in documentation (#2877)Grey Libefore adoption21b0aa6

lines 20–22why, one step back
20 $ git tag # shows the tagged versions
21 $ git checkout latest-tag-found-above22 $ cd examples/tutorial

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

lines 23–25why, one step back
23
24Create a virtualenv and activate it::25

Add prefix for all commands in documentation (#2877)Grey Libefore adoption21b0aa6

lines 26–27why, one step back
26 $ python3 -m venv venv
27 $ . venv/bin/activate

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

lines 28–30why, one step back
28
29Or on Windows cmd::30

Add prefix for all commands in documentation (#2877)Grey Libefore adoption21b0aa6

lines 31–32why, one step back
31 $ py -3 -m venv venv
32 $ venv\Scripts\activate.bat

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

lines 33–35why, one step back
33
34Install Flaskr::35

Add prefix for all commands in documentation (#2877)Grey Libefore adoption21b0aa6

line 36why, one step back
36 $ pip install -e .

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

lines 37–40why, one step back
37
38Or if you are using the master branch, install Flask from source before39installing Flaskr::40

Add prefix for all commands in documentation (#2877)Grey Libefore adoption21b0aa6

lines 41–42why, one step back
41 $ pip install -e ../..
42 $ pip install -e .

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

lines 43–49why, one step back
43
4445Run46---4748::49

Add prefix for all commands in documentation (#2877)Grey Libefore adoption21b0aa6

lines 50–53why, one step back
50 $ export FLASK_APP=flaskr
51 $ export FLASK_ENV=development52 $ flask init-db53 $ flask run

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

lines 54–56why, one step back
54
55Or on Windows cmd::56

Add prefix for all commands in documentation (#2877)Grey Libefore adoption21b0aa6

lines 57–60why, one step back
57 > set FLASK_APP=flaskr
58 > set FLASK_ENV=development59 > flask init-db60 > flask run

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

lines 61–69why, one step back
61
62Open http://127.0.0.1:5000 in a browser.636465Test66----6768::69

Add prefix for all commands in documentation (#2877)Grey Libefore adoption21b0aa6

lines 70–71why, one step back
70 $ pip install '.[test]'
71 $ pytest

Merge pull request #2676 from davidism/tutorialDavid Lordbefore adoptionc3e2ff2

lines 72–74why, one step back
72
73Run with coverage report::74

Add prefix for all commands in documentation (#2877)Grey Libefore adoption21b0aa6

lines 75–77why, one step back
75 $ coverage run -m pytest
76 $ coverage report77 $ coverage html # open htmlcov/index.html in a browser