qrgen: ułatwienia customizacji
This commit is contained in:
@@ -8,7 +8,7 @@ app = Flask(__name__)
|
||||
app.config.from_object(__name__)
|
||||
|
||||
class ReusableForm(Form):
|
||||
url = TextField("URL:")
|
||||
url = TextField("Data:")
|
||||
|
||||
@app.route("/", methods=["GET", "POST"])
|
||||
def main():
|
||||
@@ -17,9 +17,10 @@ class ReusableForm(Form):
|
||||
if request.method == "POST":
|
||||
target_url = request.form["url"]
|
||||
else:
|
||||
target_url = "http://qrgen.tau.pipebreaker.pl/"
|
||||
|
||||
return render_template("main.html", form=form, target_url=target_url, genurl="http://qrgen.tau.pipebreaker.pl/render/")
|
||||
# not POST? get back to ourselves
|
||||
target_url = request.url_root
|
||||
|
||||
return render_template("main.html", form=form, target_url=target_url, genurl="/render/")
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host='::')
|
||||
|
||||
Reference in New Issue
Block a user