Ask coding questions

← Back to all posts
Flask not working
isaiah08 (63)

OK, I'm making this big flask blogging application, but line 10 generates an error. What is wrong with it?

Answered by Coder100 (17117) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (17117)

Error

You must put this inside an @app.route function, because remember, a session requires a user, and a user requires a url!

Solution

put it in every @app.route function, like this one:

@app.route('/')
def home():
	return render_template("index.html")
isaiah08 (63)

One more question:
If you go to https://shareit-2-version-2.isaiah08.repl.co/login, enter some information, and click done, it gives an error. What is wrong? @Coder100

Coder100 (17117)

@isaiah08 you forgot to set a return value for when the user isn't logged in

RYANTADIPARTHI (6010)

I think that error means your proram took longer to run. it should not take that long, and line 10 is generating the long time thing.