Most voted "flask" questions
Flask is an MVC microframework written in Python based on Werkzeug and Jinja 2 (and good intentions, according to the official website).
Learn more…176 questions
Sort by count of
-
8
votes1
answer2502
viewsWhat are the differences between Flask and Django?
I recently started in the Python language and am currently working on a project using Flask, MariaDB and WebSockets. I see people talk a lot about Django and would like to know the differences…
-
7
votes3
answers25438
viewsHow to run programs written in Python in windows by hiding terminal feedback
I have the following situation: I have a program written in python that works with Gtk + Webkit + flask. To run such program I must enter from CMD and type "python.py file" and it starts my GUI…
-
5
votes1
answer233
viewsSet class for a table
I’m starting now with Flask and I came across the following question: how do I define a table class using the flask_table? Follow my example code and the result: from flask_table import Table, Col…
-
5
votes1
answer288
viewsStart and Take down bank in flask test
I’m doing an api test, which I pass a json it validates me if it came back all ok: my base class: # -*- coding: utf-8 -*- # base.py import os import unittest from app import initialize from mock…
-
4
votes0
answers81
viewsHow to load Flaskbb with Nginx?
I followed the documentation and installed everything without problems, but Nginx only shows his default page warning that it is running. The flaskbb forum never loads. I tried to remove import from…
-
3
votes2
answers300
viewsHow to insert checkbox dynamically from Python/Flask code?
I am trying to create a script in Flask and came across the following situation: I have in my code a for that sweeps the subdirectories of a root directory: for root, dirs, files in…
-
3
votes1
answer179
viewsSending attachment with Flask-Mail
Setting up flask and testing was quick and easy but sending attachments is very difficult if not impossible. Someone has a tip or example for sending attachments with Flask-Mail? My code is like…
-
3
votes2
answers154
viewsFlask and its contexts
I’m new to the desenvolvimento Web and I’m studying FLask and it has some objects that should only be manipulated in certain context as the Flask.g and the Flask.current_app what I can’t understand…
-
3
votes1
answer1600
viewsHow to update content without reloading an HTML page?
I built a Flask API connected to a Mysql database, which has its entries displayed in an HTML page. player_manager.py: from flask import Flask from flask import render_template from flask import…
-
3
votes2
answers53582
viewsAccess to Xmlhttprequest has been blocked by CORS policy
I have two Flask applications running locally on my machine. One is running on port 5000 and the other on port 5050. I need to make a 5000 app call to 5050. But I’m having this problem: Access to…
-
3
votes1
answer1209
viewsPOST communication Ajax for Flask
I would like a help with a Python application using the Flask framework, I want to send and receive data via Javascript using Ajax, but I’m not sure how to do, all I got was a collection of…
-
2
votes1
answer574
viewsError with Flask Babel Python3 app (Windows)
I’m following the article tutorial http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iii-web-forms/page/3#comments I got to part three and made that mistake. I’m confused because the…
-
2
votes1
answer396
viewsHow to Reverse Engineer MYSQL Database with Sqlalchemy?
I asked that question here at Stackoverflow the other day: How to import database to Django models? But now, I need something similar to Flask. I have a bank ready, using the MYSQL. I want to…
-
2
votes1
answer448
viewsReturn list of Jsons
On the path /getAll wish to return a list of Jsons but get one 'list' Object is not callable, why this occurs and how can I return to my JSON list? Formerly, Mylist was called list and after reading…
-
2
votes1
answer470
viewsBlueprints - what is the concept? for what?
As I voted for Flask(python), I now see so many examples using Blueprints. What are they? What are they for?
-
2
votes1
answer743
viewsHow to return multiple values in a python function?
I am developing an API in Python FLASK and need to show the result of a SELECT that I made via SQL ALCHEMY. But when I use return he just comes back the first ROW of SELECT. The funny thing is that…
-
2
votes1
answer949
viewsHow do I remove this warning?
Error: C: Python3 lib site-Packages flask_sqlalchemy__init__.py:839: Fsadeprecationwarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the Future.…
-
2
votes3
answers7146
viewsHow to run the method inside a.py file by linux terminal
How can I call a method that is inside a.py file directly from the linux terminal, only I don’t want to enter it prompt of python For example [fedora@user ~]$ python arquivo.py metodo parametro…
-
2
votes0
answers295
viewsHow to page using Flask and return in Json?
I need to make a query to the bank (neo4j) and return a json, but as the answer is very large precise paging. I’ve looked at the stack a lot, but most responses use the sqlalchemy pagination method…
-
2
votes0
answers280
viewsFlask not creating Sqlite database via Slqalchemy
Good afternoon to all! No way my code is creating the database via SQL Alchemy, follow the code snippet. from flask_sqlalchemy import SQLAlchemy app = Flask(__name__)…
-
2
votes1
answer126
viewsHow does the life cycle and visibility of the Flask object work. g?
In Flask there’s an object called g or Flask.g that according to the documentation is used for data storage. And this object is used when assigning something to it. For example: def get_db(): if…
-
2
votes1
answer892
viewsHow to create new routes dynamically python/flask
I am developing an application that makes predictions from models, and wanted to implement a feature that allows me to create new routes through a function. config =…
-
2
votes1
answer479
viewsHow to format datetime in a Flask application?
How can I make it show only dd/mm/yy and take the hours and seconds in my database or templates? Database: class User(db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True)…
-
2
votes1
answer62
views"local" server with python, does not receive an external POST on the same network
I have a server running on Windows 7 PC and am using Pycharm IDE to edit and simulate. This server is receiving information from an ESP32 module that is connected on the same PC network. Sending the…
-
2
votes1
answer33
viewsError in Flask development environment
I created an application in Flask, and can run normally by running only one flask run, but when I spin, it appears that it is in a production environment. When I switch to the development…
-
1
votes1
answer398
viewspython request iugu returns status 400
I’m testing the api of yugu. to generate boletus payments and I’m having problems returning json because there is no error in Dictionary items that is sent to the API (in php it would be an array)…
-
1
votes1
answer530
viewsIs Flask only used by beginners?
Flask is only recommended for those who have no experience in web frameworks, i.e., for small projects (academic projects) or is recommended to develop large projects (industrial projects)?
-
1
votes1
answer311
viewsPermission denied - Logging
I implemented the Logging python on several Flask projects successfully. But when I tried to re-implement Logging in a project it gives the following error:IOError: [Errno 13] Permission denied. To…
-
1
votes0
answers366
viewsHow to place a Progress Bar for a process in Flask?
Hello, By clicking the 'Send' button, the selected file (.jpg) is copied to several directories. I want to show this process to the user via a simple progress bar. Any hints? this is part of my…
-
1
votes1
answer168
views404 when setting an app.route in Flask
I have this simple code available on the Flask page: from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" if __name__ == "__main__": app.run() As the…
-
1
votes1
answer118
viewsMany to Many Wtforms Flask Sqlalchemy
Good night! I’m implementing a system with wtforms flask, and I stopped in the following situation: I have CRUD products and a CRUD Budget, so I will have product items in the budget (n:n). In the…
-
1
votes0
answers99
viewsTest API Python
How can I test an api url using nosetest for example: I have the following api: /api/user how to ensure that calls at this url are being called? make a GET... one POST passing the parameters on the…
-
1
votes1
answer229
viewsHow to get only one Json value using request.get_data() Flask Python
I’m a Python beginner and a hint to get only one value from the following Json. { "test1":"valortest1", "test2":"valortest2", "test3":"valortest3", "test1":"valortest1" } Use to get json as follows…
-
1
votes1
answer126
viewsConnect Flask Restless API to React (Admin-on-Rest)
I’m learning to work with flask and React to create a Rest API (with flask-Restless) and a Client (with React, Admin-on-Rest). I already created the Flask Api with Reastless. I’m looking for some…
-
1
votes0
answers35
viewsSlugfy in FLASK query
I am trying to give a Slug in a given, I tried to use Lower and replace to swap some characters, my query is similar to this: return…
-
1
votes1
answer67
viewsPython - Mongo Engine Error: Tried to save Duplicate Keys (Duplicate Key Error)
Python I am trying to save more than one user in Json but it does not accept the introduction of more than one, always gives the: Tried to save Duplicate Unique Keys (Duplicate Key Error) here is…
-
1
votes1
answer37
viewsAvoid Favicon Get in Flask
I have a client-server application in Flask, and when I get to the server, another get is done by asking for the favicon address. I wanted to know if you can not automatically do this favicon get.…
-
1
votes1
answer951
viewsFlask relationship of sqlalchemy tables
Eae personal! I come to ask a force, I have a problem to accomplish the construction of the object to create the relationship of the tables. I have a driver’s table and another passenger and another…
-
1
votes1
answer436
viewsFLASK - Changeable in template
I passed to the template a variable and need to change (in the template) the value of it. Ex.: in the controller: return render_template('index.html', start_code = start_code). I need to change…
-
1
votes1
answer291
viewsInheritance in flask models
How do I set a class to inherit another class in flask models? I am creating the following User class in my models lass User(db.Model): __tablename__ = "users" id = db.Column(db.Integer,…
-
1
votes1
answer113
viewsError running web application in flask - Python
Hello, I am trying to run this application in Flask and when I try to view the page in the browser appears server error, when I delete the line of code that creates a list of items in which each…
-
1
votes1
answer150
viewsFlask Sqlalchemy : Keyerror
I am trying to create a database relation between the Article, Author and Category class, when trying to create an Article class object I get the error "Keyerror: "article" referring to the line…
-
1
votes0
answers20
viewsHow to open vlc with flask in rapberry py
Has anyone tried to start the vlc through Flask? I am trying through API with Flask to start a video playback in vlc, it runs but does not start the graphical interface. Someone’s been through…
-
1
votes1
answer173
viewssum the database values and display the result in the flask-sqlalchemy template
have ma table with following information: class Registro(db.Model): id = db.Column(db.Integer, primary_key=True) valores = db.Column(db.Float) ------------| valores | ------------| 1.50 |…
-
1
votes1
answer243
viewsWhat’s the "@" in python for?
Several times I came across snippets of python code that used "@" as in flask: import flask App = flask.Flask(__name__) @App.route("/") Why not just App.route?…
-
1
votes2
answers220
viewsFlask Sqlalcheny Typeerror: 'Fermentables' Object is not iterable
In the model FermentableTypes: class FermentableTypes(db.Model): __tablename__ = "fermentable_types" id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(50)) desc =…
-
1
votes1
answer149
viewsCircular import
To doc of Flask, despite using in its examples, warns at the end of the page about the bad practice of using circular imports. Another thing that bothers me is creating "global objects" inside a…
-
1
votes0
answers11
viewshow to return the contents of a json to flask
I would like to return the content of a json file that is on my machine in an endpoint,basically I have a file with citations and I would like to return the content of that file in an…
-
1
votes1
answer286
viewsDeploy flask application on Heroku with flask-sqlalchemy
I have a small application written in flask and I am having problems with the database when trying to deploy in Heroku and after searching for two days I did not find any solution that suits me. In…
-
1
votes1
answer56
viewsWhat is export for FLASK_APP and FLASK_ENV?
I’m learning flask now and understand that every time I run my application, I need to run before: export FLASK_APP=app.py export FLASK_ENV=development I just memorized that I need to do this, but I…