Questions tagged [flask-admin]

Flask-Admin is an extension for the Flask framework. It can be used for building admin interfaces easily, with model scaffolding support for many existing python ORMs. Use this tag for questions related to this extension only, and not for general 'admin' functionalities in Flask.

Flask-Admin is an advanced, extensible and simple to use 'administrative interface building' extension for the Flask framework.

It comes with batteries included: model scaffolding for SQLAlchemy, MongoEngine, pymongo and Peewee ORMs, a simple file management interface and a lot of usage examples.

You are not limited by the default functionality - instead of providing simple scaffolding for the ORM models, Flask-Admin provides tools that can be used to construct administrative interfaces of any complexity, using a consistent look and feel.

Documentation: https://flask-admin.readthedocs.io/en/latest/

GitHub: https://github.com/flask-admin/flask-admin

Issue tracker: https://github.com/flask-admin/flask-admin/issues

692 questions
50
votes
6 answers

How to run Airflow on Windows

The usual instructions for running Airflow do not apply on a Windows environment: # airflow needs a home, ~/airflow is the default, # but you can lay foundation somewhere else if you prefer # (optional) export AIRFLOW_HOME=~/airflow # install from…
Rafael
  • 1,018
  • 1
  • 10
  • 18
28
votes
1 answer

DatePickerWidget with Flask, Flask-Admin and WTforms

I'm trying to render a template that contains a DatePicker, but I'm getting a 500 error when I try. For my the code is correct, but it seems that something is failing or I'm not understanding correctly the way to do it. The code is the…
Pepeluis
  • 931
  • 2
  • 10
  • 18
23
votes
4 answers

How to secure the flask-admin panel with flask-security

I'm looking to secure Web API made using Flask and integrated with flask-admin to provide an admin interface. I searched and found that flask-admin has an admin panel at /admin and by default anyone can have access to it. It provides no…
Sanyam Khurana
  • 1,336
  • 1
  • 14
  • 27
22
votes
1 answer

Flask-Admin create view with SQLAlchemy context-sensitive functions

I have a data model which has a column that depends on other column values, following the instructions in this page I've created a context-sensitive function which is used to determine the value of this particular column on creation, something like…
osjerick
  • 626
  • 2
  • 8
  • 20
21
votes
1 answer

Flask-Admin default filters

I would like to display only paid orders in my Flask-Admin model list view. Here is models.py: class Order(db.Model): id = db.Column(db.Integer, primary_key=True) amount = db.Column(db.Integer) description = db.Column(db.String) paid =…
user2672932
  • 339
  • 1
  • 2
  • 10
17
votes
1 answer

limit choices with dropdown in flask-admin

My SQLAlchemy model has a String field that I would like to limit to a few choices. I am wondering how I would be able to create a dropdown for this field in the Flask-Admin interface that would ensure that the db is only populated with one of my…
Brian Leach
  • 3,974
  • 8
  • 36
  • 75
16
votes
2 answers

Flask-Admin vs Flask-AppBuilder

I am new to Flask and have noticed that there are two plugins that enable CRUD views and authorized login, Flask-Admin and Flask-AppBuilder. These two features interest me along with nice Master-Detail views for my model, where I can see both the…
petroslamb
  • 545
  • 7
  • 14
16
votes
2 answers

Handling MongoEngine's DynamicEmbeddedDocument in Flask-Admin

I have a problem for which I can't find a simple solution, using Flask-Admin with MongoEngine. I have a Document class named ExerciseResourceContent. It has a "questions" attribute, which is a ListField of an EmbeddedDocument called…
16
votes
2 answers

Passing Arguments to ModelView edit template in flask-admin

I am trying to learn more about Flask by building a CMS. I am using flask-admin to add the posts, images etc. I have managed to override textarea with ckeditor. But I want to pass the paths of the images in the static folder to ckeditor image…
Sumit
  • 308
  • 1
  • 3
  • 8
14
votes
4 answers

Readonly form field in edit view - Flask-Admin

I tried to set a form field as readonly just for the edit view in a Flask-Admin application. Following the answers to this question I know that if I have this class MyView(ModelView): form_widget_args = { 'title': { …
osjerick
  • 626
  • 2
  • 8
  • 20
14
votes
2 answers

flask-admin form: Constrain Value of Field 2 depending on Value of Field 1

One feature I have been struggling to implement in flask-admin is when the user edits a form, to constrain the value of Field 2 once Field 1 has been set. Let me give a simplified example in words (the actual use case is more convoluted). Then I…
droptable
  • 171
  • 1
  • 8
14
votes
5 answers

Readonly text field in Flask-Admin ModelView

How can I make a field on a ModelView readonly? class MyModelView(BaseModelView): column_list = ('name', 'last_name', 'email')
user2071987
  • 213
  • 1
  • 3
  • 8
13
votes
2 answers

How to customize Flask Admin templates?

I'm trying to RTL the flask admin template, I know I can override the existing templates, but how do I change only the CSS? Any ideas?
user5182158
13
votes
4 answers

Unable to create models on Flask-admin

I'm creating a simple blog on Flask and I'm trying to implement Flask-Admin to manage my posts. If I go to the admin area I can see a list of all my post from the DB but when I try to create a new one I got the next error: Failed to create model.…
nahl
  • 237
  • 1
  • 3
  • 10
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
1
2 3
46 47