I am having problems when deploying a Flask app into pythonanywhere. I do have a signup form and when the user sings up, I want to create a folder with the username and a .josn file inside the folder to store other data that the user will input later on. It works perfectly in my local server, but when uploading
Tag: flask
Flask unable to send image back in json response
Attempting to send an image to the client browser – the following code works perfectly – please assume that I am receiving the correct base64.b64encoded byte stream: On my development box. Move it to a flask production running under gunicorn and I get JSON serialization errors: TypeError: Object of type bytes is not JSON serializable I am also getting this
What triggers the KeyError: ‘SQLALCHEMY_TRACK_MODIFICATIONS’?
I already looked at other threads concerning this error, which all indicate that this error is due to multiple instances of “app = Flask(name)”. But since I only have one, I hope someone here can help me figure this one out. I try to keep the code minimal, but enough to reproduce the error routes.py: models.py: create statements for the
Flask form validation – CSRF token middleware
I have an html form, and I would like to insure that all submissions come from my website. I think I have seen people using a key for this (I believe this happens in Django?), and might have some ideas on how to go with that. Is there any standard way to do this in Flask? Edit: Now I know
Cannot run bcrpyt or werkzeug in my python 3 environment
I am doing a course in flask and python 3. I have set up a python 3.6 environment with the following libraries in a requirement.txt file: And I am trying to run this scripts in the environment: but I get this error: Likewise when I try a werkzeug script: I get this error: I have tried: recreating a new environment
How can Jinja2 read a function without passing it explicitly?
In the flask:flashing documentation, I encounter the following situation. And here is the Jinja2 used HTML file. So I wonder that even if there is no function passed in to the HTML file by using return statement in Python file, Jinja2 can read get_flashed_messages() function, which is a function under the flask module. How is this possible? Answer Messages to
Flask testing with pytest, ENV is set to production?
I have built a flask app and i would like to create a test suite. Reading around it looks like pytest is the way to go; however, I am finding it very difficult to understand how to get going, I have looked at https://flask.palletsprojects.com/en/2.0.x/testing/ but am struggling to relate it to my app. my project has a run.py at its
Flask and Ldap3 not playing nicely together
I’m building an internal app for my company, and are looking into using ldap3 to connect to our exchange server to validate login credentials. I am integrating into a flask app and have a login view with the following code The above code works fine when I login using my actual credentials, but when I try to login using wrong
Unable to execute a query on flask using MqSQL
Hello there im trying to execute a SQL query using Flask with mysqldatabase, the query returns as a JSON managed my JQuery on the front end. The goal is to use a search bar to find any matches with the data base. The query works just fine if I use just one “like” sentence, for example. But in the moment
“TypeError: argument 1 must be str, not None” when running Flask-Kerberos
I am trying to run the Flask-Kerberos example with a valid keytab file (it works with WSGI-Kerberos). Here is the content of my ‘example.py’ file here is a ‘config.py’ and here is a ‘.flaskenv’ However, when start the Flask via flask run I am getting the following error in CMD: And I have seen some related topics (were not helpful):