Questions tagged [flask]

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

flask
21,648 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
644 views

flask template jinja not looping as expected

I have a flask app with a template inside which I have a loop using jinja syntax. The problem is I don't know why the row[5] is not changing while others are working fine. The <p>{{ row[5] }}&...
Randix Lai Randy's user avatar
2 votes
0 answers
1k views

Using different content-type in Flask Request on GAE

I'm trying yo pass a Content-Type to a flask app (running on GAE), But from python I cannot get the content type header even though I'm passing it The server-side handler is the following: @app....
DDS's user avatar
  • 2,447
2 votes
0 answers
268 views

Flask behind gunicorn not visible

I have a flask app if __name__ == '__main__': app.run( host="0.0.0.0", port=8088, debug = False, use_reloader=False, threaded=True ) which i want to run behind Gunicorn. ...
omnipollo's user avatar
2 votes
0 answers
529 views

Module not found under wsgi setup but works fine with Werkzeug server

My dir Structure: ├── app │   ├── static │   │   ├── css │   │   └── js │   └── templates │   ├── graphs │   ├── layout │   └── login_and_home ├── auth └── views.py ...
dsuma's user avatar
  • 1,010
2 votes
0 answers
685 views

Flask-WTFforms TypeError: __init__() takes 2 arguments 3 are given

Ive been trying to build this flask login system, but keep getting this error. Ive looked up with particular error and the suggestions don't seem to fit the problem in this instance. I took out two(...
ncubed's user avatar
  • 41
2 votes
1 answer
738 views

Python coverage and postman

I've built a flask restful application with what I believe to be full tests through postman. I run my tests using newman from the command line. I'm trying to use coverage.py to determine if I've ...
DeBaillie's user avatar
2 votes
1 answer
148 views

user email (correctly) shows as verified on frontend but not backend in modified firenotes

To address the close votes, all I'm asking for here is how to check that a user has verified their email in python on app engine. The relevant bit of backend python code is: id_token = request....
Ryan Haining's user avatar
  • 36.2k
2 votes
0 answers
2k views

Deploy Flask Rest API on Nginx

Could anyone help me with this? I'm trying to deploy my python flask rest api on nginx but it's not working. I've followed this tutorial but to be honest I'm not sure if this is what I need to do (I'...
NeoSennin's user avatar
  • 161
2 votes
1 answer
3k views

Accessing a database created with flask-sqlalchemy from a separate flask app

+-- myproject ¦ +-- api ¦ +-- tests ¦ +-- app ¦ +-- blueprint_1 ¦ +-- blueprint_2 ¦ +-- data_collector +-- tests +-- app +-- scraper My json api ...
pjdavis's user avatar
  • 335
2 votes
2 answers
3k views

Redirect uri error when aunthenticating with VK.com

I am trying to develop login with vk.com feature for our website. And testing it locally. In app I have given http://127.0.0.1/ as base domain. In website during authorization it is requesting ...
sudheesh ks's user avatar
2 votes
0 answers
102 views

Filter and re-order the Page objects

Flask-flatpages successfully gets all the yaml+markdown files. The point is that I only always need the pages that were published, and I need them ordered by date. Now that can be accomplished by ...
Roy Prins's user avatar
  • 2,940
2 votes
1 answer
2k views

Add dash in the URL

I want to add dash in my URL when flask automatically generate the URL. Code shown in the below: @main.route('/post_detail/<string:title>', methods=['GET', 'POST']) def post_detail(title): ...
simp1e's user avatar
  • 46
2 votes
0 answers
341 views

No trailing slash results in a 404 error in Flask app

-- Resolved without changing anything. Will update when I know what caused it to temporally not work -- I made a route to a URL without a trailing slash on Flask. This should work according to the ...
Roy Prins's user avatar
  • 2,940
2 votes
1 answer
505 views

Relative imports in Python Flask don't seem to work

I have the following directory structure for my Flask project ├── API │   ├── __init__.py │   ├── controllers.py │   ├── models.py │   └── test │   ├── first_test.py │   ├── config.py ├── ...
Sadar Ali's user avatar
  • 153
2 votes
1 answer
976 views

Flask session variable does not keep values from one call to the other

I've been trying to get this to work for a while now and I don't know what to try. I made a Flask app and I'm testing it now on localhost. I run a server for my client on localhost:8000 and another ...
Okarin's user avatar
  • 884
2 votes
0 answers
417 views

Flask-Googlelogin too many redirects

I'm using a modified version of this script: https://gist.github.com/ashish01/2a4a0f9b525096633ca2 to test out Google Logins with Flask: import json from flask import Flask, url_for, redirect, ...
LittleBobbyTables's user avatar
2 votes
1 answer
703 views

Python '_AppCtxGlobals': Attribute Error in Flask

I have implemented a code to calculate api time. @api.app.before_request def before_request(): g.request_start_time = time.time() @api.app.after_request def after_request(): elapsed = time....
Sunny Jain's user avatar
2 votes
1 answer
3k views

video streaming with flask, multiprocessing, CPU usage capped to single core level

I'm trying to use flask to do video streaming, following the instructions of https://blog.miguelgrinberg.com/post/video-streaming-with-flask. It's working, but I noticed a few things, and some strange ...
terencezl's user avatar
2 votes
1 answer
993 views

Custom Stripe Checkout with Python Flask

I'm trying to figure out how to set up custom checkout integration with Stripe on my Flask web app. I copied the code found in the Stripe documentation (https://stripe.com/docs/checkout#integration-...
M. Ying's user avatar
  • 197
2 votes
0 answers
785 views

running asyncio in Flask with mongoengine

I wanted to run four mongo queries simultaneously, wait for the results, then return the results to the user in an API endpoint in Flask. I was trying to use a coroutine in mongo and do something ...
Rob's user avatar
  • 3,466
2 votes
1 answer
361 views

flask script file structure

what does "python manage.py runserver" runs in situation below. It does not run main.py or app package. flask myApp main.py bash> python main.py flask_script manage.py ...
ali shirzad's user avatar
2 votes
0 answers
243 views

How does Flask handle request with existing application context?

According to the Flask 0.12 document (emphasis mine): The application context is created and destroyed as necessary. It never moves between threads and it will not be shared between requests... ...
nalzok's user avatar
  • 15.6k
2 votes
0 answers
42 views

Apparent circular import without known cause

I have an import error that I've been trying to solve for the past two days and still haven't been able to figure out. I'm building a REST API and I've put my source into its own module titled ...
Leighton F.'s user avatar
2 votes
0 answers
429 views

"success_action_redirect" does not work in authenticated request for browser-based upload file to S3

I am new to aws S3 and I am trying to build a web app that allows a user to directly upload a file to S3 using boto3. The user first sends request to my own server (e.g. https://example.com), and my ...
DBS's user avatar
  • 103
2 votes
0 answers
1k views

Why does a Flask apps main thread block another thread from sending data?

I have a Flask app that spawns an internal thread to send data to another server periodically. When the Flask app is initialized, the new thread is spawned: sthread = Thread(target=DataPush, args=())...
pbx's user avatar
  • 698
2 votes
1 answer
3k views

Flask, Blueprint route with defaults and methods, FormDataRoutingRedirect

I have a route that looks like so: blueprint = Blueprint('graphql', 'graphql_v0') @blueprint.route('/', methods=['POST']) def graphql_query(): ... which works fine. I want to add another path ...
azium's user avatar
  • 20.4k
2 votes
1 answer
96 views

Problems with www prefix in flask after setting SERVER_NAME for subdomains

After I set the variable SERVER_NAME to be able to use subdomains with blueprints, all pages that before worked with www. as well does not work anymore. I set SERVER_NAME = mydomain.com my apache ...
Bjørn Øst Hansen's user avatar
2 votes
0 answers
250 views

Maintain session between flask and android?

I made a web app along with a flask backend which uses MySQL as the db and everything was working fine. Now I decided to port it onto Android and use the same backend as it is with minor changes. ...
Raamish Malik's user avatar
2 votes
0 answers
729 views

Flask File Upload hangs when trying to upload PDF files

I've included "PDF" in my list of allowed extensions. # APP CONFIG SETTINGS app.config["DEBUG"] = True app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER app.config["ALLOWED_EXTENSIONS"] = set(["pdf","docx",...
Dan's user avatar
  • 31
2 votes
0 answers
1k views

AWS Elastic Beanstalk - python - requirements.txt is invalid

I'm following AWS Elastic Beanstalk's Flask tutorial to deploy my application. Though I get error Your requirements.txt is invalid - in full as below. I dont write the requirement file myself, I ...
David Serero's user avatar
2 votes
0 answers
985 views

Edit incoming request body payloads in flask api

Im looking to make my Flask based API case insensitive for all incoming payloads. rather than having to apply this to all api-route functions i want to apply this to the @app.before_request decorator, ...
callum91's user avatar
2 votes
0 answers
237 views

'MySQL server has gone away' and access denied when trying to change 'wait_timeout'

I am building a website using Flask (Python) and I have all the application files on my computer but I use an external host (InMotionHosting) for the MySQL database that probably has settings that I ...
cek11lru's user avatar
  • 389
2 votes
0 answers
269 views

flask server side session object that isn't serializable

I've decided to create an API for an algorithm I created. The idea is the user would pass some text using a POST using json, and I would run the text through the algorithm and pass it back. The ...
Roshman's user avatar
  • 33
2 votes
0 answers
51 views

Space before / in the URL is removed by Apache HTTP Server

I have apache http server running on Windows 2012 server. It hosts webapp written using Flask and python. @app.route('/temp/test/<market>/symbol/<path:symbol>/type/<product_type>/')...
shrishinde's user avatar
  • 3,307
2 votes
1 answer
122 views

Have Flask not answer a request and deliberately leave the client hanging

I would like my Flask app to ignore some requests to an endpoint and not answer them, not even with an error. The effect I'm looking for is to deliberately have the client hanging (this is to ...
Juicy's user avatar
  • 12.2k
2 votes
1 answer
3k views

ImportError: No module named google.appengine.api

when I migrate my database, i see that error. i did init. (python manager.py db init) and. migrate (python manager.py db migrate) i use google app engine, flask, mac, python what should i do? $ ...
thoutbox's user avatar
2 votes
1 answer
486 views

Best workflow for local debugging python / flask / google app engine?

I'm developing a small web-app using python + flask + google app engine. I was just wondering if anyone has found a better debugging workflow (with a local server) than me? At the moment, I'm stuck ...
Tom M's user avatar
  • 407
2 votes
1 answer
973 views

Flask on AWS EC2 and high latency when using AWS ELB

I set simple Flask app (hello world) on EC2 and when running only EC2 and go to IP address - seems to work good. All is in internal company network. Soon as I put same EC2 behind ELB - going to the ...
cikavladimir's user avatar
2 votes
0 answers
612 views

flask socketIO - incompatible with arduino Client

I tried 'simple websocket server' by https://github.com/dpallot/simple-websocket-server from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket clients = [] class SimpleChat(WebSocket): ...
Jerry's user avatar
  • 252
2 votes
0 answers
531 views

subprocess.Popen fails in nginx

I am developing a simple website using Flask + gunicorn + nginx on a Raspberry Pi with Rasbian Jessie. I am stuck at launching a process with this Python code: def which(program): def is_exe(...
Zep's user avatar
  • 1,576
2 votes
0 answers
176 views

How can I stop a running fabric tail task?

I have a flask server serving an api for running fabric tasks. So a post to url /tail, would run a tail on multiple hosts, in parallel, and output the result in a file on the local disk. @parallel ...
gplayer's user avatar
  • 1,771
2 votes
0 answers
586 views

Setting cookie on jsonify between two Flask applications?

I have two separate Flask applications, one is an application that is purely an API and returns json. The other is the main app which will call the API application to do things, like authenticate. ...
watdeo's user avatar
  • 199
2 votes
0 answers
4k views

filtering multiple columns in flask/sqlalchemy

I'm new to flask/sqlalchemy and have been trying to use filters to reject POST event when a resource in my recipe database already exist. So I want to check if, for a given user (id), a recipename ...
mobime's user avatar
  • 135
2 votes
2 answers
12k views

Best way to sort table based on headers using Flask

I have my table that gets generated based on what's in the database and would like to add the ability to sort the table based on particular columns. I tried looking online but since the table isn't ...
user1883614's user avatar
2 votes
2 answers
7k views

run flask on apache on windows

Here's the issue. I am trying to deploy my flask app in apache2.4 Server using mod_wsgi.After configuration,my apache server start to run on my computer.But when I visit http://127.0.0.1:5000/ the ...
coma's user avatar
  • 165
2 votes
0 answers
656 views

Passing credentials securely between two python applications

I'm looking for some recommendation for the following scenario. The solution that I need to build contains of: Client component written in python that uses requests module to talk to proxy component ...
Milos's user avatar
  • 29
2 votes
0 answers
318 views

Stub method when using Flask LiveServerTestCase

We're trying to test a frontend feature that sends a request to a Third Party API when a button is clicked. The click will trigger an internal API call to our Flask application, which will translate ...
Davy Cardinaal's user avatar
2 votes
1 answer
2k views

How to update many to many table in sqlalchemy?

I'm studying flask, trying to write a simple personal blog. The problem is how to update tags in post. Models are: tags = db.Table('tags', db.Column('tag_id', db.Integer, db.ForeignKey('tag.id')), ...
Dmitriy's user avatar
  • 135
2 votes
0 answers
168 views

Python Flask Divisional Accessing Base Templates

http://exploreflask.com/en/latest/blueprints.html#divisional Divisional Structure Is like Django Structure. I want to make Reusable Modular component in Flask and just call blueprint for that feature....
Holly Johnson's user avatar
2 votes
1 answer
897 views

Flask - getting the text inside an html select option tag instead of the value of the option

I have a select tag in my form <select name="source" id="source"> {% for row in inode.inodes %} <option value="{{loop.index}}">{{ row....
Oz Fraier's user avatar

1
37 38
39
40 41
433