Ask coding questions

← Back to all posts
isaiah08 (63)

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

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

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 (17122)

np! mark as correct answer please :) @isaiah08

isaiah08 (63)

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

Coder100 (17122)

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