Questions tagged [flask]

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

Flask is a web application framework for . It has exceptional documentation, a large number of extensions and a friendly community on Discord. It is open source and BSD-3-Clause licensed.

Resources

Related Tags

54068 questions
12
votes
2 answers

Flask admin remember form value

In my application, I have Users and Posts as models. Each post has a foreign key to a username. When I create a ModelView on top of my Posts model I can create posts as specific users in the admin interface as seen in the screenshot below After I…
user787267
  • 2,550
  • 1
  • 23
  • 32
12
votes
4 answers

Flask: How to use ES6 modules?

I have a working Flask app that I'm trying to refactor to use ES6 imports. I don't need it to run on old browsers, and ES6 imports work in modern browsers without transpilation, right? I'm just running this via Flask's built-in server at the…
MarredCheese
  • 17,541
  • 8
  • 92
  • 91
12
votes
3 answers

Store Excel file exported from Pandas in AWS

I'm making a small website using Flask, with a SQLite database. One of the things I want to do is take some data (from the database) and export it as an Excel file. I want to offer an option of downloading that Excel file. One option to do this is…
Vegard Stikbakke
  • 749
  • 1
  • 7
  • 21
12
votes
5 answers

Failed to decode JSON object: Expecting value: line 1 column 1 (char 0)

This question is kind of duplicate but I could not find a solution to it. When I am calling the flask app and passing the JSON data, I am getting the error: "Failed to decode JSON object: Expecting value: line 1 column 1 (char 0)

" Below is the…
Cathy
  • 367
  • 1
  • 3
  • 16
12
votes
2 answers

Pytest: setup testclient and DB

I'm trying to learn something about testing my flask app. In order to do that, I am using pytest and sqlalchemy. I want to test a template, whose delivers route some SQL content. So in my opinion I need a testClient for testing the route itself and…
Dakkar
  • 5,682
  • 5
  • 22
  • 28
12
votes
4 answers

jinja2.exceptions.TemplateSyntaxError: expected token 'end of print statement', got 'posted'

I'm new to programming and recently a friend of mine gave me a project to work on in order to get myself familiar with the programming environment and language (python in this particular example). https://www.youtube.com/watch?v=QnDWIZuWYW0 I used…
alon salzmann
  • 141
  • 1
  • 1
  • 6
12
votes
3 answers

Dynamic table with Python

I am developing a small site, which must fetch some data from an API and display it in a table (I don't know how much rows I will need, it depends on the API). I selected Python as backend programming language and Flask as a web-framework. I need to…
crinny
  • 311
  • 2
  • 4
  • 13
12
votes
12 answers

ModuleNotFoundError: No module named 'flask_session'

I have a simple python file that I am trying to set up to utilize sessions, when i run the file I am receiving the error below: ModuleNotFoundError: No module named 'flask_session' I believe I am importing the module properly, is there anything…
chris
  • 185
  • 1
  • 1
  • 10
12
votes
1 answer

Audio Livestreaming with Python & Flask

I'm currently strugling with my implementation of a simple live streaming web application using Python and Flask. It seems that I'm not able to stream my live recorded audio from the servers microphone input to the webpage. server.py from flask…
F. Geißler
  • 228
  • 2
  • 3
  • 20
12
votes
1 answer

How to map LDAP AD Groups to User roles in python flask AppBuilder

I'm currently trying to map automatically user groups in LDAP to user roles in a flask AppBuilder framework based application but can't come up with a solution. I have read through the entire flask AppBuilder documentation and didn't find anything…
Stackgeek
  • 227
  • 1
  • 12
12
votes
2 answers

How to override the html default "Please fill out this field" when validation fails in Flask?

I have a Flask-WTF form with with DataRequired validators and related error messages. However, the Chrome browser seems to ignore my error messages and just displays "Please fill out this field". How do I get Flask to override this and show my…
Ben
  • 4,798
  • 3
  • 21
  • 35
12
votes
2 answers

How to log from separate module in Flask

I have a simple Flask app like this: from flask import Flask import util APP = Flask("app") APP.debug = True @APP.route('/', methods=['GET']) def index(): APP.logger.info("info message from index") util.test() return "hello world" if…
Philip
  • 1,691
  • 4
  • 21
  • 41
12
votes
2 answers

Wrong dashboard while adding flask-admin to project

I'm trying to extend the flask-base project https://github.com/hack4impact/flask-base/tree/master/app. This uses the the application factory pattern in app/init.py and blueprints. In the app/init.py I have: import os from flask import Flask from…
user1592380
  • 34,265
  • 92
  • 284
  • 515
12
votes
3 answers

It is necessary use db.init_app or SQLAlchemy(app) is the same in Flask?

Checking Flask and Flask-SQLAlchemy doc i have a confusion, if i have: models.py: from flask_sqlalchemy import SQLAlchemy #:Use or not db = SQLAlchemy() class User(db.Model): __tablename__ = "USERS" id = db.Column(db.Integer,…
user9506223
12
votes
4 answers

Apache2 command such as a2enmod and a2ensite no working its showing command not found in Ubuntu

I am deploying Flask application in Apache2 server during this i need to run a command for enabling mod_wsgi by using: sudo a2enmod wsgi but its showing: sudo: a2enmod: command not found please help thanks
Shadab Ansari
  • 149
  • 1
  • 2
  • 9
1 2 3
99
100