Added test project I use for testing
This commit is contained in:
parent
6d072f00ad
commit
670d2bcf7a
2 changed files with 31 additions and 0 deletions
1
scripts/testproj/templates/index.html
Normal file
1
scripts/testproj/templates/index.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{{ url_for('static', filename='test.css') }}
|
||||
30
scripts/testproj/test.py
Normal file
30
scripts/testproj/test.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
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')
|
||||
Loading…
Add table
Add a link
Reference in a new issue