Simplest fastest minimal ASGI CRUD Admin panel for Tortoise ORM models. It's generating fully native async auto zero config one line app
Project description
X-Admin
Simplest fastest minimal ASGI CRUD Admin panel for Tortoise ORM models
It's generating fully native async auto zero config one line app
Requirements
- Python >= 3.11
INSTALL
pip install x-admin
Run your app
- Describe your db models with Tortoise ORM in
models.pymodule
from tortoise import fields
from tortoise_api import Model
class User(Model):
id: int = fields.IntField(pk=True)
name: str = fields.CharField(255, unique=True, null=False)
posts: fields.ReverseRelation["Post"]
class Post(Model):
id: int = fields.IntField(pk=True)
text: str = fields.CharField(4095)
user: User = fields.ForeignKeyField('models.User', related_name='posts')
_name = 'text' # `_name` sets the attr for displaying related Post instace inside User (default='name')
- Write run script
main.py: pass your models module in Api app:
from x_admin import Admin
import models
app = Admin().start(models)
- Set
DB_URLenv variable in.envfile - Run it:
uvicorn main:app
Or you can just fork Completed minimal runnable example from sample apps.
And voila:
You have menu with all your models at root app route: http://127.0.0.1:8000
Made with ❤ on top of the Starlette, TortoiseORM, X-API.
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 femto_admin-0.7.4.tar.gz.
File metadata
- Download URL: femto_admin-0.7.4.tar.gz
- Upload date:
- Size: 4.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36a164f0deeef9f2bae6a28212c6ffbcefeb06bc1779ab2bebe22106b2bfeaaf
|
|
| MD5 |
9626a6ef21f4fc8e04515ad8fe1140fd
|
|
| BLAKE2b-256 |
6a9ffa50d721eeef85f2e6e39898547068a2b02840bcfd542d5ec43ae8121f7d
|
File details
Details for the file femto_admin-0.7.4-py3-none-any.whl.
File metadata
- Download URL: femto_admin-0.7.4-py3-none-any.whl
- Upload date:
- Size: 4.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31c809092b52b8dfb6b0b452b1815fd75a848b45866432371c404cd2ee43942a
|
|
| MD5 |
7d5a46bb34720fd4749cb9e5d856538f
|
|
| BLAKE2b-256 |
12660266af9b12eadbfdea18e7f59b7f15c1a3ec26da7fce10781c5cfabbedbd
|