Skip to content
Advertisement

Tag: flask

Docker run error – Failed to find Flask application or factory in module “app”. Use “FLASK_APP=app:name to specify one

trying to dockerize this flask app… running the following docker build –tag flask-website . works, output successfully built, successfully tagged. edit: the next command works ok, so then I run curl localhost:5000 which gives this error ok straight forward enough, so then I try this docker-compose up and this results however trying to navigate to localhost:5000 I get directory structure

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’ directory and to render them

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’]. When user browses the website, no matter which endpoint, I want

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 of only doing the basics unless you tell it differently, it does

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 hosted the same on https://ethan-flask.herokuapp.com/ The blunders you did: from

Advertisement