forked from orbit-oss/flask
commit
b24438b2c9
1 changed files with 2 additions and 2 deletions
|
|
@ -32,7 +32,7 @@ Imagine the current application looks somewhat like this::
|
||||||
def user(username):
|
def user(username):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
Then the centralized approach you would have one file with the views
|
Then, with the centralized approach you would have one file with the views
|
||||||
(:file:`views.py`) but without any decorator::
|
(:file:`views.py`) but without any decorator::
|
||||||
|
|
||||||
def index():
|
def index():
|
||||||
|
|
@ -54,7 +54,7 @@ Loading Late
|
||||||
------------
|
------------
|
||||||
|
|
||||||
So far we only split up the views and the routing, but the module is still
|
So far we only split up the views and the routing, but the module is still
|
||||||
loaded upfront. The trick to actually load the view function as needed.
|
loaded upfront. The trick is to actually load the view function as needed.
|
||||||
This can be accomplished with a helper class that behaves just like a
|
This can be accomplished with a helper class that behaves just like a
|
||||||
function but internally imports the real function on first use::
|
function but internally imports the real function on first use::
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue