Skip to content
Advertisement

Tag: flask

Flask – WSGI – No module named ‘flask’

I’ve been following Sentdex’ Flask tutorial. He’s using a Venv to set up his Flask, but didn’t set his Python up to work with a Venv. I’ve tried installing Flask globally – yet it still doesn’t work. Trying to browse to the server returns a 500 Internal Server Error I’m getting the usual no module named flaskerror. errorFGL.log __init__.py flaskapp.wsgi

How can I change the host and port that the flask command uses?

I want to change the host and port that my app runs on. I set host and port in app.run, but the flask run command still runs on the default 127.0.0.1:8000. How can I change the host and port that the flask command uses? Answer The flask command is separate from the flask.run method. It doesn’t see the app or

NameError: name ‘request’ is not defined

I got this Python Code, and somehow I get the Error Message: But I really can’t find my mistake. Can someone please help me with that? Answer You appear to have forgotten to import the flask.request request context object:

Flask app getting error of “could not locate flask application. …..FLASK_APP environment variable” for Flask Migrate

I have a file db_table.py that looks like: When I try to run: I get: I tried first manually setting FLASK_APP var, by doing set FLASK_APP=app.py then running flask db init again, but that didn’t resolve the issue. Answer The flask command line argument needs to know what module to locate the current Flask app instance in. Set FLASK_APP as

Displaying a .txt file in my html using Python Flask

I want to display my log.txt in my log.html. For some reason my page is completely blank. And I dont get to see anything from my file. Code: HTML LOG TEMPLATE: Added my HTML Template now. Answer but really you probably want to use something like logstash…

Return Excel file in Flask app

I am creating a Flask application that prompts the user for an Excel file, does some work with it, then returns the file back to the user so that they can download it. (Please ignore any unused imports. I plan on using them later on.) I have my functionality down, i’m just not sure how to send the file back

Internationalization (i18n) not rendered using flask-babel and apache with mod_wsgi on Ubuntu instance

I have a web application developed using python 2.7.6, flask and deployed on a Apache Ubuntu server. For internationalization, the app uses the flask-babel package in order to translate into Thai. However, it seems that my translations/th/LC_messages/messages.po file is ignored. It works perfectly in my localhost but not in the server. To force the selection of the locale, I use

Why is my website throwing POST error in python?

I’m sending request to League of Legends API for JSON file. In 3 others tries it worked for me, but in last it doesn’t. I have no idea why and can’t find any mistakes. My request for getting JSON file My website function for return the results. Place, where is mistake, is highlighted with comment. Last, but not least, my

Advertisement