Ask coding questions

← Back to all posts
isaiah08 (87)

Is the error flask or replit.db, and what can i do to fix it?

Answered by Coder100 (18902) [earned 5 cycles]
View Answer
Coder100 (18902)

You forgot to close the request, remember to always return something!

@app.route('/', methods=['GET', 'POST']) 
def main(): 
	if request.method == 'POST':
		email = request.form['email'] 
		db[email] = ""
		return "done!" # <---
	if request.method == 'GET':
		return render_template('index.html')
Coder100 (18902)

np! mark as correct answer please :) @isaiah08

isaiah08 (87)

When i have it print db.keys it doesn't print anything though. (i moved db.keys to after db[email] @Coder100

Coder100 (18902)

wait can you invite me i can't see the output @isaiah08