0
votes
1answer
16 views

How to access directories with flask

So I am making a website that has different accounts stored under the accounts folder path so for example I have a account folder for Bob and an account for John under each folder they both have a ...
0
votes
0answers
15 views

Python Tornado: WSGI module missing?

I did a pip install tornado but I cannot run the following code because WSGI module is missing?? http://flask.pocoo.org/docs/deploying/wsgi-standalone/ from tornado.wsgi import WSGIContainer from ...
0
votes
0answers
20 views

Passing a user object to a flask view using a decorator

I want my authorization decorator to be able to pass a custom user object to the view that it decorates. Currently, I am having the decorator set an attribute on flask.g to do this. Is this ...
1
vote
1answer
18 views

Python Flask working with wraps

Trying to setup a login page with Python and Flask and getting an Error: (line 33 is the with @login_required) Traceback (most recent call last): File "routes.py", line 33, in <module> ...
1
vote
0answers
39 views

python's zip function with compression and operating systems

I currently have a flask app which uses send_from_directory() to send a zip file. The zip file is constructed by a simple python script, which is structured very much around the example in Python ...
0
votes
0answers
12 views

Deploying mod_wsgi flask app on EC2 instance

I have been through countless guides and the official documentation on the flask website. However, I cannot get me app deployed on this instance (which already has a website, I just want to be able to ...
2
votes
1answer
27 views

How to POST multiple FILES using Flask test client?

In order to test a Flask application, I got a flask test client POSTing request with files as attachment def make_tst_client_service_call1(service_path, method, **kwargs): _content_type = ...
0
votes
1answer
55 views

Google app engine or Other hosting? [on hold]

I'm in Thailand and I'm working on the python (Flask framework), HTML5 website project. My website is a small static website. All of my visitor are Thai people only. I have heard people says that If ...
0
votes
2answers
27 views

Python, how can I import modules that are in sub-directory?

I am using Python and Flask to build a project. How can I import modules that are in sub-directory? here is the directory structure. /application /apis settings.py index.py and here is the ...
0
votes
1answer
22 views

Python: route different domains to different flask instances running on different ports

Basically when the server gets request from asdf.com it should go to the flask instance running at 5000, when server gets request from fdsa.com it should go to another flask instance (totally ...
0
votes
1answer
25 views

Google Oauth2.0 with Python: How do I limit access to a specific domain?

I'm trying to understand how to limit access to my application when using this Python Oauth2.0 example. I've seen places where you can add an hd=domain.com to the end of an authorize_url but that ...
0
votes
0answers
34 views

PayPal retrieving notify_url values. Python, Flask

I am using a PayPal button to accept payments for my site, but I need a way to retrieve transaction details. The obvious way would be to use notify URL. I am using Flask. from flask import Flask from ...
0
votes
1answer
21 views

flask-mail AttributeError: 'function' object has no attribute 'send'

I am trying to use flask.ext.mail to send email, however I am getting the following error. I followed a number of tutorials and they all seem to be doing the same thing, I have been looking around to ...
0
votes
2answers
37 views

Deploying Flask app on EC2 for localhost access

I have finished up a simple Flask app that I am trying to host on an AWS EC2 instance with Apache2. I've been following this tutorial. The only changes I've made from the development process (in ...
0
votes
0answers
40 views

Serving real-time data python web application

I am writing a Python web application with the Flask framework, WSGIServer and geventwebsockets. I have a thread pool of workers doing heavy processing work which then insert completed data into a ...
0
votes
0answers
33 views

Jinja2 highlight

I have installed jinja highlight in a small flask app. The highlighting works great when used directly in templates, but when I call it from the database and try to apply it on an entry, it does not ...
0
votes
1answer
13 views

Attribute lost when rendering the object to view in Flask

This is a rather silly issue but I stepped through the function but couldn't figure out what was causing the issue. I was dynamically adding an attribute to the object I fetched from the db via ...
1
vote
0answers
39 views

Slow response time getting json data from Flask application from javascript

I have a Flask application that takes requests from javascript, queries a database, then sends the data back to be visualized using D3.js. Calls to the database return rougly 5mb of data. I am ...
0
votes
1answer
37 views

Preprocess function Flask Restless

I'm trying to combine Ember.js and Flask Restless, but am running into difficulties interfacing the JSON API. The problem is that I need to massage the JSON to match what Ember is expecting client ...
0
votes
1answer
27 views

AJAX/JSON in server-side: pass all arguments to a Python dictionary (Flask)

I have a jQuery AJAX call in my Javascript that sends a lot of information to the server: (Javascript) $.ajax({ datatype: "json", url: SCRIPT_ROOT + '/email', data: ...
0
votes
1answer
62 views

Flask&Pandas: upload a csv as a pandas Dataframe and pass it through views

I am starting to build an app that allows the user to upload a csv. Then, the csv will be loaded as a Pandas Dataframe. With that dataframe, several calculations will be done, sometimes prompting the ...
1
vote
2answers
48 views

Flask-SQLAlchemy Constructor

in the Flask-SQLAlchemy tutorial, a constructor for the User model is defined: from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) ...
1
vote
0answers
19 views

Make peewee admin work with flask security

I like both peewee and Flask security, and they both work well together, but I can't get the admin functionality of peewee to work. I am really not sure about how to do this, but I really want to use ...
0
votes
0answers
15 views

Twisted based remote method invocation in Flask

I am trying to integrate a remote method of twisted to the Flask based website. I am sending a piece of text to the server and getting a true and false. The stand alone frameworks fine. But when I am ...
1
vote
1answer
19 views

Flask logging with Foreman

I'm trying to set up a Heroku-ready Flask app, but I can't figure out how to turn on logging. Without Foreman, I could create a helloworld app as described in the Flask tutorial: from flask import ...
0
votes
0answers
54 views

why do my 'for' loop is done two times?

In my app, I have a for loop that create a dict according to the form answers. It seems it's executed two times, so the first dict(which is good, I can see it) is erased by the second one. I don't ...
1
vote
0answers
36 views

Why using the “safe” filter in jinja creates nested elements

I have a python dictionary called "asides". The values of this dict are html snippets loaded from my database and I want to inject them into a jinja template. The below is the jinja snippet: <div ...
0
votes
1answer
23 views

Efficiently serving large static files to many clients after login with Flask

I have to serve very large static files to multiple clients, but some clients do not have access to all files, so my server has to check for the file permissions for each client, and I cannot use ...
0
votes
1answer
27 views

How do I populate a select tag with Flask?

I am trying to access a list of JSON objects (from mongo) in python to populate a dropdown list using flask templates. Subsequently, I need to access the selected item. I am having difficulty ...
1
vote
2answers
23 views

Multiple backend servers accessible from a Flask server

I want to have a front-end server where my clients can connect, and depending on the client, be redirected (transparently) to another Flask application that will handle the specific client needs (eg. ...
2
votes
1answer
26 views

Custom attributes for Flask WTForms

I develop website on Flask and AngularJS. I need to send a form whith AJAX using AngularJS but it requires a custom attribute for input field. For example I have a form in Jinja2 template: <form ...
0
votes
1answer
34 views

Flask SQLAlchemy filter records from foreign key relationship

I have 2 models: class Scenario(db.Model): __tablename__ = 'scenarios' scenario_id = db.Column(db.Integer, primary_key=True) scenario_name = db.Column(db.String(120)) scenario_text = ...
2
votes
1answer
32 views

Flask matplotlib graphics in template

I have a pretty beginner-question. Is it possible to display dynamically processed matplotlib images (as shown in https://gist.github.com/wilsaj/862153 or https://gist.github.com/rduplain/1641344) ...
0
votes
1answer
17 views

going parallel through two lists in a jinja2 template

I am currently writing a small torrent client with flask. My problem is that when I deal with files priorities, I have two list of the files to deal with, each one containing specific ...
1
vote
1answer
23 views

How to make Flask respond in same HTTP version as request

How can I get flask to respond with HTTP/1.0 to a HTTP/1.0 request? Or someway force a HTTP/1.0 response? Right now I just do flaskext.genshi.render_response('tmplate.xml', ...data...) But when I ...
1
vote
1answer
22 views

How to reference a ModelView in flask-admin

What's the right way to get the URL for a flask-admin ModelView? Here's a very simple example: my_admin_view.py from flask.ext.admin.contrib.sqla import ModelView from common.flask_app import app ...
1
vote
1answer
34 views

why does flask logs only when app.debug = True?

in main : handler = RotatingFileHandler('/tmp/mylog') handler.setLevel(logging.DEBUG) app.logger.addHandler(handler) my_glob.logger = app.logger app.debug = True app.run(host='0.0.0.0', port=80) in ...
2
votes
2answers
45 views

Flask-Login check if user is authenticated without decorator

From the Flask-Login docs, it's described how a user of the system can require an authenticated User-model to access a method utilising the decorator syntax: from flask_login import login_required ...
1
vote
2answers
48 views

How to pass URL with parameters in GET request in Flask?

In Flask, I want to send an URL in the URL as a parameter with all its parameters Here is a working example ...
0
votes
2answers
38 views

No module named flask using virtualenv

I am following these steps to learn flask http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world/page/0#comments I ran this command to create the virtual env: python ...
1
vote
0answers
31 views

Heroku / gunicorn / flask app says “Connection in use”

I have a Flask app that runs fine on local, but when I push to Heroku I get the error message: * Running on http://127.0.0.1:5000/ [INFO] Starting gunicorn 18.0 [ERROR] Connection in use: ...
0
votes
2answers
24 views

Single-Passcode Authentication on a Flask App

I'm trying to put a simple login before my flask app--no databases, no remembering usernames, just a form, and if the input to the form matches a password, let them in. I've been walking through ...
0
votes
0answers
20 views

Alternatives to CGI on shared hosting without root access [on hold]

I have a mostly academic problem, but I'm curious if there's a way to solve it that I don't know about. I'm trying to find the best way to host a flask application on a shared hosting environment. I ...
0
votes
1answer
46 views

Issue setting up Flask site

I'm working through a short Flask tutorial and am having some issues. I got to the end and got a 500 Server error. If I run the .fcgi from within my virtual environment I get the message below. I ...
1
vote
1answer
39 views

Flask URL Display

I have a custom url that looks like @app.route('/user/<user_name>/<param>') def show_param(user_name, param): #do something The page displays fine and is working well but param can ...
2
votes
2answers
39 views

Flask multi-process worker pool in Python

I am pretty confused on the best way to do what I am trying to do. I have a series of jobs that take a lot of time to process and so I would like to initialize a substantial pool of "workers" on app ...
0
votes
0answers
26 views

Python Flask before_request parse XML

I'm developing Flask XML-RPC API Application (using Flask-XMLRPC). Many functions require username. I can check if username is set in functions that require it, but in this case i will made huge code ...
0
votes
1answer
35 views

How to show all errors in the browser on Flask framework?

I use Flask framework and build a Python project. It shows all errors on the page when I run a python file on the SSH shell. After I installed WSGI to run the server automatically, it started not ...
2
votes
2answers
1k views

Redirect HTTP to HTTPS on Flask+Heroku

When I attempt to redirect incoming traffic to https I get an infinite redirect loop. @app.route('/checkout/') ...
1
vote
2answers
963 views

Flask url_for generating http URL instead of https

I an using url_for to generate redirect url when a user has logged out. return redirect(url_for('.index', _external=True)) However when I changed the page to a https connection, the url_for still ...

15 30 50 per page