2015-02-05 01:02:32 +01:00
|
|
|
#!/usr/bin/python3
|
2015-02-12 22:06:31 +01:00
|
|
|
#/* vim:set ts=2 set noexpandtab */
|
2015-02-06 22:03:42 +01:00
|
|
|
from flask import Flask, render_template, url_for, request
|
2015-02-05 22:17:33 +01:00
|
|
|
app = Flask(__name__)
|
2015-02-05 01:02:32 +01:00
|
|
|
|
2015-02-05 22:17:33 +01:00
|
|
|
@app.route("/")
|
|
|
|
def index():
|
2015-02-12 22:06:31 +01:00
|
|
|
return render_template("search.html")
|
2015-02-05 22:17:33 +01:00
|
|
|
|
2015-02-12 22:06:31 +01:00
|
|
|
@app.route("/categorys")
|
2015-02-05 22:17:33 +01:00
|
|
|
def categorys():
|
2015-02-12 22:06:31 +01:00
|
|
|
return render_template("categorys.html")
|
2015-02-05 22:17:33 +01:00
|
|
|
|
2015-02-05 22:38:39 +01:00
|
|
|
@app.route("/create")
|
|
|
|
def create():
|
2015-02-12 22:06:31 +01:00
|
|
|
return render_template("create.html")
|
2015-02-05 22:38:39 +01:00
|
|
|
|
2015-02-06 22:03:42 +01:00
|
|
|
@app.route("/search", methods=['GET'])
|
|
|
|
def search():
|
2015-02-12 22:06:31 +01:00
|
|
|
return render_template("result.html", results=request.args.get("q", ""))
|
2015-02-06 22:03:42 +01:00
|
|
|
|
2015-02-05 22:17:33 +01:00
|
|
|
if __name__ == "__main__":
|
2015-02-12 22:06:31 +01:00
|
|
|
app.run(debug=True)
|