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.
35 lines
809 B
35 lines
809 B
from flask import Flask, request, make_response, Response, render_template, redirect, url_for
|
|
|
|
app = Flask(__name__, template_folder='templates')
|
|
|
|
|
|
@app.route('/')
|
|
def index():
|
|
myval = 'Kynsight'
|
|
myres = 30
|
|
mylist = [10,20,30,40,50]
|
|
return render_template('index.html', value=myval, result=myres, list=mylist)
|
|
|
|
@app.route('/aaawwa')
|
|
def other():
|
|
return render_template('other.html')
|
|
|
|
|
|
@app.route('/filter')
|
|
def filter():
|
|
sometext="Hewllo World"
|
|
return render_template('filter.html', sometext=sometext)
|
|
|
|
# Custom filter
|
|
@app.template_filter('reverse_string')
|
|
def reverse_string(s):
|
|
return s[::-1]
|
|
|
|
|
|
@app.route('/redirect_endpoint')
|
|
def redirect_endpoint():
|
|
return redirect(url_for('other'))
|
|
|
|
if __name__ == '__main__':
|
|
app.run(host='0.0.0.0', port=5000, debug=True)
|