current_email = ''
@app.route('/habits', methods=['POST'])
def saving():
global current_email
email_receive = request.form['email']
habits_receive = request.form.getlist('habits[]')
current_email = email_receive
@app.route('/habits', methods=['GET'])
def listing():
global current_email
habit_list = list(db.habits.find({}, {'_id': 0}))
user_habit_list = []
for habit in habit_list:
if habit['email'] == current_email:
user_habit_list.append(habit)
username=current_email.split("@")[0]
return render_template("habits.html", email=username, habits=user_habit_list)
=> 따로 버튼을 만들어야하는가?