0
votes
1answer
8 views

Flask SQLAlchemy db.create_all() not creating database

I can't seem to figure out why my call to db.create_all() is not working. I have an app package with following init: from flask import Flask from config import config from flask.ext.sqlalchemy ...
0
votes
1answer
22 views

Flask use SQL query at client side

I am doing a small project in Python / Flask.. My database model consists of two tables say post and comments.. Post table consists of the posts and the comments table consists of the comments for the ...
-1
votes
0answers
29 views

How to create flask form to get data dynamically from db and write back in db selected data only [on hold]

I want to create a form in flask such way that i can upload image and put name of image and select location of image from my db and then display all images from that place and can select some images ...
0
votes
1answer
12 views

Flask: Server becomes unresponsive after some time

I use a flask server to serve static files from a server but once in a while the server becomes completely unresponsive, downloading a file keeps loading but never downloads. When I opened up the ...
3
votes
1answer
30 views

How to run recurring task in the Python Flask framework?

I'm building a website which provides some information to the visitors. This information is aggregated in the background by polling a couple external APIs every 5 seconds. The way I have it working ...
-1
votes
1answer
27 views

How to generate encrypted url link in flask for image file [on hold]

i'm using flask and want to have blueprint like my code below. i want to generated encrypted url link return and imagefile display in web browser. i read itsdangerous module but have no idea how to ...
0
votes
1answer
23 views

Flask SQLAlchemy relationship

I have a pretty simple model in Flask and SQLAlchemy, with companies playing matches. A match is defined by a host and a guest. I don't know how to bring the host and the guest companies to the ...
-1
votes
1answer
30 views

How to JSON dump data to a Flask app route? [on hold]

I am working on a webapp. I am running a python script and it collects some data now I want json dump of that data and pass it to a Flask webapp route. somthing like this route ...
0
votes
0answers
8 views

Testing flask.ext.restful url route resolution

I have some flask.ext.restful application code like # Providers api.add_resource(ProvidersListAPI, '/providers', endpoint ='providers') api.add_resource(ProvidersAPI, ...
0
votes
0answers
29 views

404 Not Found when trying to access Flask-Admin on uWSGI

i'm a newbie in web programming, so i'm expecting to be missing a super simple thing in my configuration, hoping you can help me! (Also forgive my english - heh) So here's the thing: I'm on my little ...
1
vote
1answer
18 views

Flask: Custom Error handler resulting in TypeError: isinstance() arg 2

I have an issue using Flask and creating a custom error handler. I want to offload my error handling to a separate class and have followed the documentation here: ...
0
votes
1answer
12 views

Flask Json Request 400 logging?

I wrote my own custom client which sends raw http requests via my wifi card to my flask webserver. This is what a typical requests looks like: Content-Length: 214 User-Agent: blah Connection: close ...
3
votes
1answer
34 views

How to post data using requests module to a flask application?

I am trying to develop a small tiny application using flask and requests module. I tried to post some data to a flask web application. But I stuck at this error. flask.py @app.route('/add/', ...
0
votes
0answers
20 views

Flask restless operators not filtering properly

I'm developing a login for a mobile web app using Flask and Flask restless. For the moment I have only 1 record in my database for testing, when I send my AJAX request to Flask restless, it seems to ...
0
votes
2answers
42 views

Flask renders css file as empty

I've been working on a simple Flask app, and at some point decided to add custom CSS styling alongside Bootstrap. However, for some reason, this CSS file is rendered as empty file. Whether I open it ...
0
votes
2answers
41 views

Would I be missing anything or running into walls if I want to develop Django/Flask web apps in Windows? [on hold]

I know that there are some issues with rails development under Windows and all the people are suggesting to switch to OS X/Ubuntu. I run a company and I need to stick with Windows (7). I cannot ...
0
votes
1answer
26 views

How do I make this function redirect to a given html page?

I'm trying to write a simple script for an exercise I created using Flask, that calculates a tip amount from a meal value entered into a form. The first function below (meal_total) takes the value ...
0
votes
1answer
27 views

Abort 404 not working in flask after request

I have a multi domain website with flask but I want to restrict access to all views and blueprints except those I allowed access to them in some domains. So I decided to use flask after request ...
-1
votes
0answers
33 views

How to get else statement to work properly for message elements in Flask

I'm having a issue that's kinda hard for me to explain properly. How would I get the success message to pop up when a email is sent without making the contact form disappear? I know I would just use ...
1
vote
1answer
37 views

Why can't I get the database lastrowid?

I want to record form data and pass it to the another page, so I was just going to pass it the (autoincrementing) row id and then retrieve it in the next function. It is properly creating the database ...
2
votes
1answer
26 views

How to enable CORS in flask and heroku

I am trying to make a cross origin request using jquery but it keeps being reject with the message XMLHttpRequest cannot load http://... No 'Access-Control-Allow-Origin' header is present on ...
0
votes
1answer
11 views

How do I directly reference a table column in a database relationship?

Ok, my google-fu fails me. I want to have 2 relationships specified in a single table. Specifically, in the code below, I want to have the User.written field reference directly to the ...
0
votes
0answers
16 views

Need help for Flask babel configuration

aI have a flask project and the folder structure is like below: /myproject /env /project /apps /app1 /app2 ... /utils __init__.py config.py babel.cfg ... I don't ...
0
votes
1answer
14 views

Flash not working on redirect during unittest testing

I have an endpoint that does some logic and a flash()and then redirects to another endpoint, which adds another flash and displays both flashed messages. When I test the endpoint in my browser, I get ...
0
votes
0answers
17 views

How to protect from huge uploads in flask? [duplicate]

Originally my question was identical to the question asked here (I wanted to know how to check the size of the uploaded file "on-the-fly"). From the answers given on the linked page I got some ideas ...
0
votes
1answer
30 views

Why `request.files` is empty?

I am trying to follow this simple tutorial for file submissions in flask. To submit files I use the following HTML form: <form action="" method="post" "enctype=multipart/form-data"> <table ...
0
votes
1answer
20 views

Flask import error

I have workspace and task blueprint in flask with workspace view workspace/apis.py and task view task/apis.py I want to import Task class from Task model in workspace/apis.py but i can't. workspace ...
-1
votes
1answer
25 views

IndentationError: unexpected indent when returning a variable after form submission

I'm new to Flask and started exploring with simple functionalities. The idea is to have a form with just one field and read this form data and pass it to another function to do something else. So for ...
0
votes
0answers
14 views

Passing variable as a parameter in the URL using Flask, python [duplicate]

I have small flask app where I get URL of a page via a simple input form and show the content on that page. Currently everything is done on localhost:5000. My goal is to get the URL value so that ...
0
votes
1answer
32 views

Best practices for debugging vagrant+docker+flask

My goal is to run a flask webserver from a Docker container. Working on a Windows machine this requires Vagrant for creating a VM. Running vagrant up --provider=docker leads to the following ...
0
votes
2answers
34 views

Interpreting nested HTML <blockquote>s in Python?

I have a web app that reads from the Tumblr API and reformats the way that "reblog chains" are formatted. With Tumblr, commentary for a post is stored as HTML blockquotes. As users respond to the ...
0
votes
0answers
18 views

Link error as chain in celery

I have a function where I kick off a sample job and update the database accordingly. My function is like this: def schedule_sample_job(hosts): parent_job_id = 'SampleBatchJob|%s|Phantom' % ...
0
votes
1answer
12 views

Flask save request files cannot handle two consequent images

I am sending two images each from different process using AsyncTask in Android to my Flask backend where I am saving these images like this if allowed_file(filename): try: ...
0
votes
1answer
38 views

With Flask and Angular, how do I make $scope variables available to a python function

I am kind of a beginner so I don't even know the best way to do this or what to call what I am trying to do, but I am making an event posting app which will have a header of the month and year like in ...
1
vote
2answers
55 views

Uploading file with AngularJS fails

Below are the snippets of my code regarding file upload. Here is my HTML code where I will choose and upload the file: <form ng-click="addImportFile()" enctype="multipart/form-data"> ...
0
votes
1answer
29 views

GroupBy and Sum in SQLAlchemy?

I am trying to group a few fields in a table, and then sum the groups, but they are getting double counted. My models are as follows: class CostCenter(db.Model): __tablename__ = 'costcenter' ...
0
votes
1answer
27 views

Alembic migration issue with PostgreSQL schema and invalid one-to-many relationship

I've created a database and schema in Postgres. I have my models and when I run python manager.py db migrate which uses Flask-Migrate, I get the error below. However, the db init command works. ...
0
votes
1answer
32 views

Showing element in html with flask and BeautifulSoup 3 and Python 2.7.8

The question is: I have my @app.route and the relative def() which shows a list of urls taken from "http://annotaria.web.cs.unibo.it/documents/". How can i show this urls in a html format? When i ...
0
votes
1answer
22 views

Gunicorn Keeps Restarting/Breaking on Flask App

I have a Flask App I'm trying to transition to running through gunicorn. I'm experiencing a lot of problems with this. Here's the run code for my app: app.run(host=HOST, port=PORT, debug=DEBUG_FLAG) ...
0
votes
2answers
41 views

How to efficiently define daily constant?

Using the (awesome) Python Flask framework, I'm building a website, for which I have 3 "constants" which change every morning (so my constants are not very constant, I know, but still). I need these ...
0
votes
2answers
22 views

Flask already disable CSRF but self.errors still have the error “'csrf_token': ['CSRF token missing']”

I have the following view which logins a user. I am using flask-wtforms for forms. def login(self, username, password): return self.app.post('/users/login', data=dict( email=username, ...
0
votes
1answer
26 views

load a relationship in a to_json method

I have a fairly basic CRUDMixin class CRUDMixin(object): """ create, read, update and delete methods for SQLAlchemy """ id = db.Column(db.Integer, primary_key=True) @property def ...
1
vote
1answer
26 views

Release Python Flask port when script is terminated

I have a Python Flask server that uses HTTPS. When I press CTRL-C to terminate, the listner is still running (I have to run in the shell: sudo fuser 8080/tcp -k to kill it). I want a better way of ...
0
votes
0answers
22 views

Using flask's render_template for non-displayed HTML pages

I'm using flask and in this application I need an HTML file to be generated based upon input and then uploaded to Amazon S3. I know that render_template can be used to dynamically create HTML, but can ...
0
votes
2answers
37 views

Is it possible to view the logic/code behind a method of a python module?

I'm using the OpenID module as part of a flask application. I've been looking in the module directory to see which methods are accessible, but was wondering if it's possible to see the code/logic ...
0
votes
0answers
76 views

flask app won't run on ubuntu 12.04 (digital ocean)

I am having difficulties deploying a basic flask app on a digital ocean server running ubuntu 12.04, apache2, and mod-wsgi. I have tried a number of different modifications of both the myapp.conf ...
0
votes
2answers
22 views

PyCharm resolving - flask.ext.sqlalchemy vs flask_sqlalchemy

If I use the following format in my application, everything works, except PyCharms resolving / autocomplete feature: from flask.ext.sqlalchemy import SQLAlchemy If I use the following format in my ...
0
votes
0answers
43 views

How do I share code between python applications [closed]

I have a Pyramid (it could be Django, Flask - doesn't matter) web application that uses,say some custom Foo framework (written by me) to parse Bar files. The parser is invoked when website users want ...
0
votes
0answers
25 views

Flask, gunicorn, redis - Getting 500'd the 3rd route, but POST works in previous steps

I'm trying to set up a local copy of web-dedupe working with the default setup, but it simply will not work for me after the third step. I'm able to upload the CSV, but after the fields are selected ...
1
vote
1answer
36 views

Why does running the Flask dev server run itself twice?

I'm using Flask for developing a website and while in development I run flask using the following file: #!/usr/bin/env python from datetime import datetime from app import app import config if ...