I have defined a URL in my python codes and I need to read it and save it in a json file then save them in a list or dictionary. In my codes I read and print them. Also, I would like to know is there any issue in my codes such as post method or read key value pairs
Tag: flask
Why is flask-session in plain text?
I have a server-side session file created and I am new to web applications. I don’t understand why the session files when opened with text file has plain content inside it. I have a secret key setup and all but why is it not encrypted? And on login the file route is And on logout the route is WHen the
Flask TypeError: ‘method’ object is not subscriptable
I am building a dictionary app with Flask where users can add new words, the code below is the app.py file, I am having issues with the POST request, the error I am receiving on my terminal is this: This code below is the app.py file here is my dashboard page or route: Answer get_json is the actual method, which,
No module named app , While running Flask app
I’m new to using flask, I tried to execute a basic flask app in Visual-Studio-code . but I’m getting, No Module named app My code is: path : The output terminal: Answer The path of app.py was inside the virtual environment , thus it is not working. Moving it out of that folder woks.
ERR_TOO_MANY_REDIRECTS in a Flask application. Works in local but not in server
In local my Flask application works fine, and when I use /editing_buddy it redirects me correctly. The thing is, when I upload it to the server, it always gives me 404 Error. If I try to use @app.route decorator, I get a TOO MANY REDIRECTS error. My server is hosted by Wikimedia in funpedia.toolforge.org if that helps. It’s a webservice
Python Flask cookie consent
I want to set a banner that asks for permission to store cookies on my website(because GDPR). I’ve tried like this: HTML: and jinja2 The prints are for debugging. The problem is that the list is always empty and the banner is never showing. What should I do to make this work? Does that mean that the site is not
Flask static file importing issues
I’m trying to write my first webapp with Flask. I learned that to use css in my site, I have to use a static folder, because my css is never gonna change while the site is running (when it is online). So i created it, wrote a bit of css, imported it in my html via this portion of code
Display documents in a table from MongoDB with Jinja2 HTML
I currently try to figure out how to display multiple documents from my MongoDB collection “one by one”. My recent code to fetch the data looks like this: My HTML Jinja injection like this: The code itself works fine – but literally all URLs are displayed in one row of course. Right now I can’t find a good way to
How do I fix this error in Spyder: No module named ‘flask’
Updated: So after doing some digging I was able to find that if I add a ‘!’ before pip it allows me to run pip inside of Spyder. (I was unable to run pip inside the console originally. That is why below you will see I ran a version check on flask in a python cmd Here I’m trying to
TypeError: __init__() got an unexpected keyword argument ‘number’
I am using Flask to create a /register before call the /login page. This error show when I submit my register and go to ‘/login’. This is my ‘app.py’: This is my ‘init.py’ This is my ‘models.py’ This is the “Traceback” I just wanna understand my problem to solve it. I tried to search this problem, finding some cases, but