19 lines
523 B
Python
19 lines
523 B
Python
from autoreply_editor import app
|
|
from flask import Flask, request, render_template, redirect
|
|
|
|
@app.route("/")
|
|
def index():
|
|
with open(app.config.get("MESSAGE_FILE"), "r") as f:
|
|
message = f.read()
|
|
|
|
return render_template("index.html", message=message)
|
|
|
|
@app.route('/', methods=['POST'])
|
|
def index_post():
|
|
input_message = request.form['message']
|
|
|
|
if request.method == 'POST':
|
|
with open(app.config.get("MESSAGE_FILE"), 'w') as f:
|
|
f.write(str(input_message))
|
|
return redirect("/")
|