Forums

static file url has gone all relativy to the file requesting it...

My flask application for handling this URL somehow has started corrupting the URL for the css file. Browser Gets this served file (note the word add at the end) http://XXXXXXX.pythonanywhere.com/question/0/add within it..... <link rel="stylesheet" type="text/css" href="static/quiznite.css">

Browser pulls in this
http://XXXXXXX.pythonanywhere.com/question/0/static/quiznite.css

when really it should be getting

http://XXXXXXX.pythonanywhere.com/static/quiznite.css

My code is this...

@app.route('/question/<int:id>/<string:action>', methods = ['GET', 'POST']) def web_addquestion(id,action):

some code!!!!

That's because that's what you're telling it to do. static/quiznite.css is relative to the page it's in. If you want it to be an absolute path, then use an absolute path: /static/quiznite.css

Thanks! Colour and all the trimmings have materialised cheers!