File tree 10 files changed +37
-0
lines changed
examples/patterns/largerapp
10 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ this::
17
17
login.html
18
18
...
19
19
20
+ If you find yourself stuck on something, feel free
21
+ to take a look at the source code for this example.
22
+ You'll find `the full src for this example here `_.
23
+
20
24
Simple Packages
21
25
---------------
22
26
@@ -130,6 +134,7 @@ You should then end up with something like that::
130
134
131
135
132
136
.. _working-with-modules :
137
+ .. _the full src for this example here : https://github.com/pallets/flask/tree/master/examples/patterns/largerapp
133
138
134
139
Working with Blueprints
135
140
-----------------------
Original file line number Diff line number Diff line change
1
+ from setuptools import setup
2
+
3
+ setup (
4
+ name = 'yourapplication' ,
5
+ packages = ['yourapplication' ],
6
+ include_package_data = True ,
7
+ install_requires = [
8
+ 'flask' ,
9
+ ],
10
+ )
Original file line number Diff line number Diff line change
1
+ from yourapplication import app
2
+ import pytest
3
+
4
+ @pytest .fixture
5
+ def client ():
6
+ app .config ['TESTING' ] = True
7
+ client = app .test_client ()
8
+ return client
9
+
10
+ def test_index (client ):
11
+ rv = client .get ('/' )
12
+ assert b"Hello World!" in rv .data
Original file line number Diff line number Diff line change
1
+ from flask import Flask
2
+ app = Flask (__name__ )
3
+
4
+ import yourapplication .views
Original file line number Diff line number Diff line change
1
+ from yourapplication import app
2
+
3
+ @app .route ('/' )
4
+ def index ():
5
+ return 'Hello World!'
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ commands =
10
10
# We need to install those after Flask is installed.
11
11
pip install -e examples/flaskr
12
12
pip install -e examples/minitwit
13
+ pip install -e examples/patterns/largerapp
13
14
py.test --cov =flask --cov-report html []
14
15
deps =
15
16
pytest
You can’t perform that action at this time.
0 commit comments