Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flask-admin-panel

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flask-admin-panel

Simple Admin Panel for Flask

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

Flask-Admin-Panel

A Flask extension that enables Admin Panel for Registed Flask-SQLAlchemy Models.

Example

Setting up the Flask-Admin-Panel is simple:

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_admin_panel import FlaskAdminPanel

app = Flask(__name__)
app.config["SECRET_KEY"] = "<replace with a secret key>"
app.config["APP_ADMIN_USER"] = "<replace with a your user name default is admin>"
app.config["APP_ADMIN_PASSWORD"] = "provide a strong password"
app.config["SQLALCHEMY_DATABASE_URI"] = "provide a sql alchemy database uri"

db = SQLAlchemy(app)

adminpanel = FlaskAdminPanel(app,db)

Registring the models to Flask-Admin-Panel :


#Create any model
class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True, nullable=False)
    email = db.Column(db.String(120), unique=True, nullable=False)

    def __repr__(self):
        return '<User %r>' % self.username

# Provide unique name to model and SQLAlchemy.Model class
adminpanel.serv_admin_panel.register_model_for_admin_panel("User",User) 

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc