Skip to main content

Simple and extensible admin interface framework for Starlette/FastApi

Project description

starlette-admin

Starlette-Admin is a simple and extensible admin interface framework for Starlette/FastApi.

Test suite Publish Codecov Package version Supported Python versions

The key features are:

  • Flexibility : The biggest feature of Starlette-Admin is flexibility. Start with autogenerated CRUD-views of your model and customize those views & forms as the need arises.
  • Datatables : Starlette-Admin use Datatables to render list. Main Features included are:
    • Multi-column ordering: Sort data by multiple columns at once.
    • Full-text search: Filter results by text search with highlight.
    • Search Builder: Filter results by complex query including AND and OR conditions.
    • Many Export options: Export your data to CSV, PDF, Excel and Browser Print.
    • You can easily include any other features you need from datatables. Read Datatables documentation for more information.
  • Files Handling : Easily attach files to your model. Thanks to SQLAlchemy-file for SQLAlchemy integration
  • Multiple admin : Expose multiple admin interfaces.
  • Modern UI using Tabler

This project is inspired by Flask-Admin and the main goal is to provide similar tool for Starlette/FastApi.

Starlette-Admin is designed to work with any ORM but have currently built-in support for:


Documentation: https://jowilf.github.io/starlette-admin

Source Code: https://github.com/jowilf/starlette-admin


Demo Application

starlette-admin-demo is a complete Starlette application that showcases Starlette-Admin features.

click here to check the online version

Installation

PIP

$ pip install starlette-admin

Poetry

$ poetry add starlette-admin

Example

SQLAlchemy integration

from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.ext.declarative import declarative_base
from starlette.applications import Starlette
from starlette_admin.contrib.sqla import Admin, ModelView

Base = declarative_base()
engine = create_engine(
    "sqlite:///example.db", connect_args={"check_same_thread": False}
)


class Post(Base):
    __tablename__ = "posts"

    id = Column(Integer, primary_key=True)
    title = Column(String)


class PostAdmin(ModelView, model=Post):
    pass


Base.metadata.create_all(engine)
app = Starlette()

admin = Admin(engine)
admin.add_view(PostAdmin)
admin.mount_to(app)

MongoEngine integration

import mongoengine
from mongoengine import connect
from starlette.applications import Starlette
from starlette_admin.contrib.mongoengine import Admin, ModelView

connect("example")


class Post(mongoengine.Document):
    title = mongoengine.StringField(min_length=3, required=True)


class PostAdmin(ModelView, document=Post):
    pass


app = Starlette()

admin = Admin()
admin.add_view(PostAdmin)
admin.mount_to(app)

Now visiting /admin on your browser you can see the Admin interface.

Project details


Release history Release notifications | RSS feed

This version

0.1.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

starlette-admin-0.1.1.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

starlette_admin-0.1.1-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file starlette-admin-0.1.1.tar.gz.

File metadata

  • Download URL: starlette-admin-0.1.1.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.9.13 Linux/5.15.0-1019-azure

File hashes

Hashes for starlette-admin-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eb1b5ceaa760f86c24df8a9442d494e07a6d82810948008e08a200783168ca70
MD5 a3f5d82be3e4d1c31f279d01c3c508fe
BLAKE2b-256 64adf0da7c5a9fa71067ac1967cc0e24aef742ea82eb1646f1741e49401aedb9

See more details on using hashes here.

File details

Details for the file starlette_admin-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: starlette_admin-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.9.13 Linux/5.15.0-1019-azure

File hashes

Hashes for starlette_admin-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b93237fd32ea66e1a9e0823df7ca09ec7b19116c50e13b98583f9ea03fc6d7a4
MD5 ecd968b7da40b728a965d038435a2030
BLAKE2b-256 8515ea147d16123881505ce042eb964fb27cb0487f090aeaa66c60cf8ce45843

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page