Skip to content

Tag: flask

Flask: unable to serve rendered pages from specific directory

I have a bunch of files in a directory that I wish to render and serve to the user, but have been unable to. Going to the path always returns just the ‘page_template.htm’ and not the rendered file. Here’s my code: What I wish to do is to grab raw text files from the ‘Special_Data&#8217…

Flask flash message on all endpoints

In my Flask app I have user management done via flask.session. So all info about logged in user is stored in session. When some new user registers, in database I create new row with one attribute being verified set to false and the same information is stored in session[‘user’][‘verified&#821…

curl getting redirect instead of response

I’ve tested my REST API via Postman and tests and got a response, but when I use curl I’m getting screen from postman enter image description here the code: app.py route.py controller.py Answer By default curl doesn’t follow redirection, you have to use -L argument. In curl’s tradition…

Flask App Deployment: Internal Server Error

I recently tried to deploy a flask app using Heroku. However, I encountered an internal server error. My code can be found here: https://github.com/chaneth8/Task_List. This is the message that appeared on my log in Heroku – what could the error be? Thanks in advance. Answer I studied your code and hoste…