Questions tagged [flask]

Flask is a lightweight framework for developing web applications using Python.

0
votes
0answers
6 views

Flask-SQLAlchemy: SQLALCHEMY_ENGINE_OPTIONS not set up correctly

I just updated my projects Flask-SQLAlchemy Version to the latest one (v2.4). As some of the SQL-Alchemy config parameters were deprecated, I now follow the documentation and added ...
0
votes
0answers
7 views

How to register dynamically created tables in metadata

I have a sqlite database behind my flask application in which I upload tables from csv files using the pandas to_sql function. All tables are correctly uploaded into my database, but not registered in ...
0
votes
0answers
7 views

Failed to find Flask application or factory in module “config” Use "FLASK_APP=config:name to specify one

I'm install Flask-SQLAlchemy in a virtual environment. I'm install Flask-Migrate: pip install flask-migrate Created a class config.py: import os basedir = os.path.abspath(os.path.dirname(...
0
votes
0answers
12 views

how to get host container name along with automatic download of a file

I am running an application inside docker container and want to get the container's id(host name) in html along with an automatic download of a file without any button or hyperlink. I can do one of ...
1
vote
1answer
7 views

How can I start an asynchronous function in Flask / gunicorn / gevent?

I currently have a Flask application from flask import Flask import time app = Flask(__name__) @app.route('/') def foobar_view(): long_running() # TODO: Just trigger this; don't wait for ...
0
votes
1answer
23 views

How to sort a part of a column text?

I have a column_default_sort set to custom_id which format is for example 10/K/2019 I want to sort look only for the 10/ part so the letters wouldnt break the number sort, how to set it up in flask-...
0
votes
0answers
5 views

when some microservice goes down then there is a chance to change IP address when it reloaded..then, how to set IP and port of each microservices?

I'm going to deploy my microservices on DCOS, and they will communicate using REST API with each other I know when some microservice(ex: regist user , create post ...so on) goes down, then it will ...
0
votes
0answers
14 views

How to stream audio from flask server from a raspberry pi?

I'm trying to take an audio stream coming from the aux jack or connected microphone on my raspberry, and stream it out to a web page where it can be connected by another device on the local network. ...
0
votes
0answers
9 views

My gunicorn application emits 'connection refused error'

Problem Summarize Hi, I'm making flask server. It contains flask-socketio, tensorflow, .etc. When I run this gunicorn application by running gunicorn -k gevent -w 3 run:app, the terminal goes well ...
2
votes
0answers
10 views

Unable to display highcharts graphs with setextremes

I am collecting info from weather sensors(every 5 mins) and through the days and months, the amount of records is huge and render the chart takes for ever....It is working ,but the delay is too high......
0
votes
1answer
22 views

Display unique values on flask jinja template

I have a query on my views.py: query = db.session.query(Basket, Fruits).filter(Fruits.basket_id == Basket.id) In the html template, I wish to display for each basket id (basket id here is unique), ...
0
votes
2answers
11 views

Flask SQLAlchemy custom field name for foreign key?

Relationship = Many Heros have one Planet. I'd like to be able to call hero.home_planet because the Star Wars characters move around in space a lot. But under my model, the field is called planet_id. ...
0
votes
2answers
30 views

How can I reorder the selection of selectpicker based on my user selection?

I am planning to implement a selectpicker, which will allow user to choose multiple options from the dropdown list. The catch is that when my backend extract the values from this selectpicker, the ...
0
votes
0answers
8 views

Flask-Admin thumbnails size

I following this code to upload image with Flask-Admin. And now I want to resize the size of the thumbnail according to my case. I try to do that in this snippet of code: form_extra_fields = { '...
0
votes
0answers
21 views

Error importing a module into my Flask App

I'm making a flask application on an apache server running Ubuntu 16.04.6. I'm having a very strange issue with importing a module. My init.py containing my app begins with from flask import Flask, ...
0
votes
1answer
14 views

Flask Method Not Allowed

I'm working on a flask project and getting a method not found error. I am simply trying to go from my homepage to my game page at the press of submit button. I can't figure out where I am going wrong. ...
0
votes
1answer
12 views

direct a log to a specific handler, but not others, in Python logging

I have a Flask application for which I would like to write a global_error_handler method that takes parameters like email_admin and only emails the admins when this parameter is True. If I wanted to ...
0
votes
1answer
10 views

How to join all subprocess before exiting in Flask? atexit.register does not work when server does exit(1)

I'm trying to write a /kill API for flask, that works as expected. Would also like to run some cleanup activity and join all subprocess. But the implementation method is not called when the server ...
-3
votes
0answers
23 views

Capture face in webcam and send to flask

Hye Experts, I have a question. currently I am working with face recognition project by using face_recognition library provided by Python, flask and OpenCV. Currently my face recognition works well in ...
0
votes
0answers
11 views

How to hook up nginx reverse proxy to flaskapp(all running in containers)?

I'm trying to deploy a dockerized flaskapp with nginx. I have two containers, one for the flaskapp, another for nginx and I'm using docker-compose to run both. However, when I do docker-compose up and ...
0
votes
1answer
13 views

Remove session on each request when using raw sqlalchemy

I must use raw SqlAlchemy library with Flask app because of some things. When I read this link, I ran into this: "To use SQLAlchemy in a declarative way with your application, you just have to put ...
-1
votes
0answers
10 views

unable to run flask file because of ssl error

C:\Users\Naph\Desktop\flask\flaskBlog>python flaskBlog.py Traceback (most recent call last): File "flaskBlog.py", line 1, in <module> from flask import Flask File "C:\ProgramData\...
0
votes
1answer
31 views

Running a Python Script from within Flask

I am trying to run another python script through Flask at the end of certain functions. I have tried os.system(labpinger.py) as well as below in my code, writing a function to call the script but ...
-1
votes
0answers
37 views

Flask Flask_mysqldb (MySQL) raise AssertionError in app route method

AssertionError AssertionError: A setup function was called after the first request was handled. This usually indicates a bug in the application where a module was not imported and decorators or other ...
0
votes
0answers
23 views

Why does Azure Active Directory OAuth work for me and no one else?

I am developing a Python/Flask application and I want to use OAuth for signing in. My employer uses Azure Active Directory so I am trying to integrate with it as an OAuth provider. I am not an Azure ...
0
votes
2answers
21 views

how do I catch urllib.error.HTTPError: HTTP Error 403: Forbidden?

I'm writing a Flask app where I call a method that might return 403. I figured the following code would handle the error appropriately: try: connection = myLib.Login(username, password) except ...
0
votes
1answer
14 views

How can I synchronize some Flask-RESTful Resources?

I have an Flask-RESTful API that acts as a gateway to TCP devices that cannot handle asynchronous calls to them. Since for me Resource objects just spawn, I cannot queue and manage them from a ...
-1
votes
1answer
16 views

How to populate HTML fields from database data using Flask [duplicate]

I want to fetch data from a database using flask-alchemy, based on a string value I have passed from another screen. But here's the problem, I get a 400 error for my password and I don't know what I'm ...
0
votes
0answers
34 views

why do i still get SyntaxError: Non-UTF-8 code starting with '\x90' in file? [duplicate]

I am not sure why my command flask run is not working. It just says SyntaxError: Non-UTF-8 code starting with '\x90' in file C:\Users\admin\Anaconda3\Scripts\flask.exe on line 1, but no encoding ...
0
votes
0answers
20 views

Sharing a variable between Celery tasks [duplicate]

I am using Flask with Celery & Celery beat. I have a task that is running every 2 and 10 minutes. I need to store a global object that each task can access at any given time. Here's my ...
0
votes
0answers
22 views

Send video stream from client to flask server with opencv

I have a web camera and I successfully capture frames, and after putting them in a loop, I have a video stream. The code is here: client.py import numpy as np import cv2 import requests addr ='...
-3
votes
0answers
10 views

auto generate table of content links for blog posts in Flask

I am developing a personal website using flask which will have blog posts. I am using MySQL to store blogs, ckeditor to add or edit posts and materializecss. On the blog post page, I would like to ...
0
votes
1answer
21 views

Plotly Dash Core components not rendering when set in call back and output to children

I want to have a set of dynamic controls in a dash app that changes upon input of a drop down. These values come from a pandas dataframe. However, when i set the return value in the callback to be a ...
0
votes
0answers
20 views

how to mock or unit test the celery task custom update

The celery is used in connexion flask. the celery worker is remote. In celery task has a update the status. How to mock the custom task status in unit test. celery broker is rabbit mq, celery backend ...
-1
votes
1answer
20 views

connecting mongodb server via seperate class

I am using flask to create simple api. The api simply returns values from mongoDB. Everything works great if i do the connection within same function. I am not doing connection simply at start of file ...
0
votes
2answers
47 views

How to fix this issue with flask along with session management?

I am getting an error which says as below when I am working with this along with session management. werkzeug.exceptions.BadRequestKeyError werkzeug.exceptions.HTTPException.wrap.<locals>....
-1
votes
0answers
29 views

Can we use Expressions delimiters “{{ }}” within Statement delimiter “{% %}”

I want to use "jinja2" for showing comments and reply functionality for my blog website using "Flask" so i was trying to show reply within comments section as show in example or please suggest if ...
0
votes
3answers
33 views

How to add views to a blueprint in separate files

I have a huge application that was getting hard to update its views. To 'fix' this, I had separate the views into a few files, using blueprints. The problem is that the blueprints are also getting ...
0
votes
1answer
34 views

Running a yolo model in the flask server itself. How to?

I am working on an application in which as soon as I run the flask server my webcam should start(which it does!) and show the yolo model on the webpage itself(the one that I have runs independently, ...
0
votes
1answer
27 views

How to fix CSS 404 error when using variables in Flask route

I am writing a simple web application to display book reviews. A successful search returns links to book titles -- when a user clicks on a link, I am attempting to pass the ISBN of the book that was ...
0
votes
0answers
11 views

How to get Flask to see Vue build files without using webpack?

I'm pretty new to Vue and modern web development in general, so I apologize in advance. Here's the situation. I'm trying to make a simple Flask app that uses Vue and Vuetify on the frontend. When I ...
0
votes
1answer
23 views

How do i create multiple dynamic selectpicker based on my jinja for loop?

Currently, I am trying to create multiple dynamic select picker dropdown list based on user input. This input will be passed over to my HTML page via jinja in a for loop. Based on the for loop, i ...
-3
votes
0answers
11 views

Manage multiple object instances running on distant server

I'm new to Python and I wrote a class object that we will call DummyClass. I have uploaded my .py file to a distant server and I want to be able to manage many DummyClass object instances. a = ...
0
votes
1answer
11 views

Use zerorpc inside Flask app throws error “operation would block forever”

I have a RPC Server using zerorpc in Python, written this way import zerorpc from service import Service print('RPC server - loading') def main(): print('RPC server - main') s = zerorpc....
0
votes
1answer
14 views

How to test a non-view function in a Flask app factory?

I'm using the factory pattern in Flask. This is a simplified version of my code: def create_app(): app = Flask(__name__) @app.before_request def update_last_seen(): if ...
0
votes
0answers
18 views

Multiple Dynamic Databases in Flask

I am trying to set up a Flask based CRUD app to use multiple databases. One is fixed containing Users and Projects. If I need to create a new project then I want a template based database to be ...
0
votes
1answer
24 views

Flash Message pop up without redirect

I am trying to find a way to get Flask flashed messages to pop up without having to redirect the page. Basically if you enter some matching mnemonic pattern, it will search the database and display it ...
-1
votes
0answers
23 views

How can I manage to set up notification channel between two Flask apps? [on hold]

I have two separated Flask apps. One for pure http Json API (connexion) and another as notification service which serve web-sockets for clients (flask-socketio). From time to time I need raise some ...
0
votes
0answers
8 views

Changing setlocale in flask app has no effect

In my flask app i want to change the locale setting to 'nl_NL' so that i can have calendar.day_name[] in Dutch but this has no effect. I am running the flask app in a docker container The day ...
0
votes
0answers
9 views

Render WTForms FieldList with flask_bootstrap

I am trying to render a form that contains a FieldList using flask_bootstrap. These are my form classes: forms.py class FormEntry(FlaskForm): selectfield = SelectField('Name', coerce=int) ...

http://mssss.yulina-kosm.ru