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.
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
ANDandORconditions. - 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
Online Demo: Demo
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file starlette-admin-0.0.2rc0.tar.gz.
File metadata
- Download URL: starlette-admin-0.0.2rc0.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.15 CPython/3.9.13 Linux/5.15.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2c59459868e6fe45dde4076649e528898a2293adfb4367399a67a2b4228574a
|
|
| MD5 |
db30d58081a3f489c2612ebed3b66290
|
|
| BLAKE2b-256 |
1f9a06ab146a17e4499762a29618b295d4e9d099badcf3055af54af877f1d2ea
|
File details
Details for the file starlette_admin-0.0.2rc0-py3-none-any.whl.
File metadata
- Download URL: starlette_admin-0.0.2rc0-py3-none-any.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.15 CPython/3.9.13 Linux/5.15.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a5c963b211051b0a169d277212e40aa62be857084c38a40c42d57ae33be7c76
|
|
| MD5 |
eee7a65dfb2f1eaa4df240e5d7121bc1
|
|
| BLAKE2b-256 |
6cffb72cb2cbb82c4e9f9a03825a0b1fe688ab7c17c50d327029bbda6d1fe82e
|