mirror of https://github.com/mitsuhiko/flask.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
501 B
31 lines
501 B
14 years ago
|
from flask import Flask, Module
|
||
|
|
||
|
|
||
|
mod = Module(__name__)
|
||
|
mod2 = Module(__name__, 'testmod2')
|
||
|
|
||
|
app = Flask(__name__)
|
||
|
app.register_module(mod)
|
||
|
app.register_module(mod2)
|
||
|
|
||
|
|
||
|
@app.after_request
|
||
|
def after_request(response):
|
||
|
g.db.close()
|
||
|
return response
|
||
|
|
||
|
|
||
|
@mod.route('/')
|
||
|
def index():
|
||
|
return render_template('test/index.html')
|
||
|
|
||
|
|
||
|
@mod2.route('/')
|
||
|
def index():
|
||
|
return render_template('testmod2/index.html')
|
||
|
|
||
|
|
||
|
@mod2.route('/')
|
||
|
def index():
|
||
|
return render_template('something-else/index.html')
|