flask

wsgi:error ModuleNotFoundError in my webapp model

wsgi:error ModuleNotFoundError in my webapp model Question: Hello IT ladies and IT gentlemen. Please, help me with non-recognized folder "devices". I have a program for reading data from robot. And data are stored in "devices" folder. My file structure: GRP devices _ _ init _ _.py dev1.py dev2.py dev3.py webapp.py tools _ _ init _ …

Total answers: 1

Flask: Get the function within the before_request

Flask: Get the function within the before_request Question: I want to se a session scope from within a before_request function, so it would act like a yield or a decorator callback: @contextmanager def db_session(): """Provide a transactional scope around a series of operations.""" session = Session() try: yield session session.commit() except Exception as e: session.rollback() …

Total answers: 1

Flask form not validating on submit

Flask form not validating on submit Question: I’m trying to make a form that looks like an exam page. I have a checkbox and a submit button, the submit button when clicked does not do anything. The HTML code in exam.html {% extends ‘layout.html’ %} {% block content %} <h3 class="pt-5 p-4">exam page</h3> <div class="form"> …

Total answers: 1

How to filtering out json object contain certain key in FLASK?

How to filtering out json object contain certain key in FLASK? Question: I have a JSON file : { "id":"xyz", "word":"this is word", "formats":[ { "formatId":"xz99", "pengeluaran":"pengeluaran_1", }, { "formatId":"xy100", "pengeluaran":"pengeluaran_2", }, { "ukuran":451563, "formatId":"xy101", "pengeluaran":"pengeluaran_1", }, } in my python.py files, i want to filtering out the JSON object only contain "ukuran" as a …

Total answers: 1

How should i store api call data for a webserver

How should i store api call data for a webserver Question: I’m building a Flask web application. I use an API to retrieve data once per day. The data is returned as JSON. The JSON is stored in a file, and is sent to the client each time they access the site. The application uses …

Total answers: 1

How to print out all values in dictionary using for loop

How to print out all values in dictionary using for loop Question: Hello I am trying to print out all values of an object from Firebase in Python but instead , it prints only the first value @app.route(‘/get_racer’,methods=[‘GET’] ) data = db.(“child”).get() for x in data.each(): print(x.val() ) Asked By: Kevin Fiadzeawu || Source Answers: …

Total answers: 1

Can't load variables into site.css for Flask app to render home.html

Can't load variables into site.css for Flask app to render home.html Question: I’m really struggling with trying to get my site.css file to accept two variables being passed in from my app.py using Jinja2 template i.e., {{ variable }}. Within app.py, I am defining two variables called: empty_fill_line and fill_line, which dynamically update with respect …

Total answers: 1

Is template rendering and forms in Flask used with SPA frontend?

Is template rendering and forms in Flask used with SPA frontend? Question: let’s assume I have created SPA style frontend (React). How should I host it with a Flask app? Should i return json data from flask app? Are Flask templates and forms still used (e.g. FLask-WTF) with SPA? Or is Flask backend currently created …

Total answers: 1