Flask

Celery Task Custom tracking method

混江龙づ霸主 提交于 2021-02-11 14:39:44
问题 My main problem relies on the fact that i need to know if a task is still queued, started or revoked. I cant do this with celery and redis because 24hs after the results are in redis they are deleted. I had some ideas but i think the most solid one is to have a database tracking and manually adding the critical information that i need of the task a user is running. There are methods for that that can run before a task start and i can also manually work with the database when i create task or

how to have full control over a process (start/terminate) which runs in parallel with flask application?

我的未来我决定 提交于 2021-02-11 14:15:23
问题 This is my application architecture: In my code there is a pedestrian.py file which uses a while loop to read frames from rtsp link and after doing pedestrian detection process (available in this link), it caches the frame in Redis. (please note that in the loop each time the output frame is replaced with the previous output from loop. it means that there exists only one frame in redis in any moment.) Then in flask application, I read processed frame from redis and send it for the clients.

issue in running the flask project

五迷三道 提交于 2021-02-11 14:00:36
问题 I'm not able to run the flask application, the error is error: Could not locate a Flask application. You did not provide the "FLASK_APP" environment variable, and a "wsgi.py" or "app.py" module was not found in the current directory. 回答1: To get better pointed to the root of your problem answer, please specify what kind of operating system you are using. Usually, the problem is in the format of the command people use to set the value of the system variables. Check that you put spaces around '

django-plotly-dash serve css files locally

社会主义新天地 提交于 2021-02-11 13:58:51
问题 I am trying to serve css files locally in a DjangoDash app using django-plotly-dash. Simpleexample.py app = DjangoDash('SimpleExample', serve_locally=True) app.css.append_css("path_to_css") app.layout = html.Div([ html.Div( className="app-header", children=[ html.Div('Plotly Dash', className="app-header--title") ] ), html.Div( children=html.Div([ html.H5('Overview'), html.Div(''' This is an example of a simple Dash app with local, customized CSS. ''') ]) ) ]) simpleexample.html {% extends

django-plotly-dash serve css files locally

我怕爱的太早我们不能终老 提交于 2021-02-11 13:57:30
问题 I am trying to serve css files locally in a DjangoDash app using django-plotly-dash. Simpleexample.py app = DjangoDash('SimpleExample', serve_locally=True) app.css.append_css("path_to_css") app.layout = html.Div([ html.Div( className="app-header", children=[ html.Div('Plotly Dash', className="app-header--title") ] ), html.Div( children=html.Div([ html.H5('Overview'), html.Div(''' This is an example of a simple Dash app with local, customized CSS. ''') ]) ) ]) simpleexample.html {% extends

wtforms returns only None

▼魔方 西西 提交于 2021-02-11 13:56:09
问题 I have the following HTML, CSS and JS code. However, when I use the search from the top right side and press enter. Flask only get "None" and what was typed in search. This is the route for the search: @app.route("/quick_search/", methods=("GET", "POST")) @app.route("/quick_search/<property_id>") def quick_search(property_id=None): form = QuickSearch() print "???", form.propert_name.data and this form class: from flask.ext.wtf import Form from wtforms import SelectField, StringField,

AttributeError: 'tuple' object has no attribute 'keys'

狂风中的少年 提交于 2021-02-11 13:40:59
问题 I'm trying to insert some data to my table in MSSQL using flask+sqlalchemy. I'm using Python 3.4. My code: @main.route('/create-user', methods=['GET', 'POST']) def create_user(): form = NewUser() if form.validate_on_submit(): login = form.name.data passwrd = form.password.data print (login) #getting login is ok print (passwrd) #same engine.execute( text("INSERT INTO my_table VALUES ((CONVERT(binary, :login)), (CONVERT(binary, :passwrd)))"), login, passwrd) session.commit() flash('Succesfull')

Python Flask: pass Jinja variable to backend

依然范特西╮ 提交于 2021-02-11 13:32:08
问题 I have a simple Flask web app showing a table that I read from a TSV file (using Pandas). For each row, I'm showing the index, some text, a label (positive/negative) a date, and a "change label" button. I want to be able to change the label in the TSV file for the specific text for which I clicked the "change label" button. I was thinking of using a URL like /edit/<index> so I can use the index passed in the URL to find the corresponding row in the TSV and change it, but without luck. For

Google Api Client - AttributeError: 'str' object has no attribute 'authorize'

﹥>﹥吖頭↗ 提交于 2021-02-11 13:05:36
问题 My code was working up until I decided to move my Google Api credentials into my Docker env. I'm using Flask as a web server framework. This is my set up: DOCKER: docker-compose-dev.yml environment: - FLASK_ENV=development - APP_SETTINGS=project.config.DevelopmentConfig - GOOGLE_APPLICATION_CREDENTIALS=/usr/src/app/project/api/resources/youtube/urls/project-84a0ef4dcd33.json FLASK: config.py class DevelopmentConfig(BaseConfig): CREDENTIALS = os.environ.get('GOOGLE_APPLICATION_CREDENTIALS')

Running Flask via FastCGI in IIS at application level instead of website leve

此生再无相见时 提交于 2021-02-11 12:36:14
问题 I've configured the basic Flask web sample in a VENV and now it is correctly published through IIS via FastCGI. Well, here it is my trivial sample00.py from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello, World, from Flask!" and the web.config, a little more involved: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <handlers> <add name="PythonHandler" path="*" verb="*" modules="FastCgiModule" scriptProcessor="F:\Appl\flask\venv