fastapi-admin is a fast admin dashboard based on FastAPI and TortoiseORM with tabler ui, inspired by Django admin.

Overview

FastAPI Admin

image image image image

中文文档

Introduction

fastapi-admin is a fast admin dashboard based on FastAPI and TortoiseORM with tabler ui, inspired by Django admin.

Installation

> pip install fastapi-admin

Requirements

Online Demo

You can check a online demo here.

  • username: admin
  • password: 123456

Or pro version online demo here.

  • username: admin
  • password: 123456

Screenshots

Run examples in local

  1. Clone repo.

  2. Create .env file.

    DATABASE_URL=mysql://root:[email protected]:3306/fastapi-admin
    REDIS_URL=redis://localhost:6379/0
    
  3. Run docker-compose up -d --build.

  4. Visit http://localhost:8000/admin/init to create first admin.

Documentation

See documentation at https://fastapi-admin.github.io.

License

This project is licensed under the Apache-2.0 License.

Issues
  • 默默潜水看了你这个项目一段时间了

    默默潜水看了你这个项目一段时间了

    不知道有没有兴趣我们一起开发 我现在做了一个平台也是基于fastapi的 咱们一起做吧

    opened by zky001 15
  • windows 怎么办?

    windows 怎么办?

    安装依赖时报错 RuntimeError: uvloop does not support Windows at the moment

    opened by gcshine 14
  • admin/login POST does not work

    admin/login POST does not work

    Hello, nice project and thanks for sharing. I have successfully deployed and it seems everything is working. I can use the followig command:

    curl -X GET "http://192.168.1.75:8000/admin/site" -H "accept: application/json"

    and get a proper result. But if I use the following:

    curl -X POST "http://192.168.1.75:8000/admin/login" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"username\":\"marco\",\"password\":\"123456\"}"

    I am getting:

    {"msg":"Not Found"}

    which I don't think it is correct. In docker container "fastapi-admin" logs I am finding:

    INFO: 192.168.1.111:41788 - "POST /admin/login HTTP/1.1" 404 Not Found

    opened by mg64ve 13
  • Example - 404 Error

    Example - 404 Error

    Hi, before integrating your solution into my project, I tried to execute your example :

    image

    The application start well :

    image

    And the data are injected into the database :

    image

    But when I try to navigate to 127.0.0.1:8000/admin, I have an 404 error :

    image

    image

    Otherwise, 127.0.0.1:8000/admin/docs works

    My configuration :

    • os: Ubuntu 18.04
    • docker: 19.03.13
    • docker-compose: 1.26.0

    If you need more informations, do not hesitate to ask me.

    Thank you !

    opened by AlexTheByte 12
  • facing issue in running docker

    facing issue in running docker

    Dear Sir,

    File "uvloop/loop.pyx", line 1994, in uvloop.loop.Loop.create_connection app_1 | ConnectionRefusedError: [Errno 111] Connection refused app_1 | app_1 | ERROR: Application startup failed. Exiting. app_1 | INFO: Started server process [1] app_1 | INFO: Waiting for application startup. app_1 | ERROR: Traceback (most recent call last): app_1 | File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 526, in lifespan app_1 | async for item in self.lifespan_context(app): app_1 | File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 467, in default_lifespan app_1 | await self.startup() app_1 | File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 502, in startup app_1 | await handler() app_1 | File "./examples/main.py", line 34, in startup app_1 | redis = await aioredis.create_redis_pool("redis://localhost", encoding="utf8") app_1 | File "/usr/local/lib/python3.9/site-packages/aioredis/commands/init.py", line 188, in create_redis_pool app_1 | pool = await create_pool(address, db=db, app_1 | File "/usr/local/lib/python3.9/site-packages/aioredis/pool.py", line 58, in create_pool app_1 | await pool._fill_free(override_min=False) app_1 | File "/usr/local/lib/python3.9/site-packages/aioredis/pool.py", line 383, in _fill_free app_1 | conn = await self._create_new_connection(self._address) app_1 | File "/usr/local/lib/python3.9/site-packages/aioredis/connection.py", line 111, in create_connection app_1 | reader, writer = await asyncio.wait_for(open_connection( app_1 | File "/usr/local/lib/python3.9/asyncio/tasks.py", line 442, in wait_for app_1 | return await fut app_1 | File "/usr/local/lib/python3.9/site-packages/aioredis/stream.py", line 23, in open_connection app_1 | transport, _ = await get_event_loop().create_connection( app_1 | File "uvloop/loop.pyx", line 2017, in create_connection app_1 | File "uvloop/loop.pyx", line 1994, in uvloop.loop.Loop.create_connection app_1 | ConnectionRefusedError: [Errno 111] Connection refused app_1 | app_1 | ERROR: Application startup failed. Exiting. fastapi-admin_app_1 exited with code 0 (testpy3.9) [email protected]:~/Python-3.9.1/fastapi-admin$ sudo docker-comp

    opened by pvssrikanth 12
  • PK values only integer

    PK values only integer

    Hi! It's me again))

    Could you please replace type annotation for pk path params in the admin routes with Union[int, UUID]?

    It would allow to use UUID type for primary keys.

    opened by Addovej 8
  • can´t find setup.py

    can´t find setup.py

    Hi Sir, I don´t understand step 3 of that local example. There is no setup.py, the command "python setup.py install" fails.

    opened by xbln 8
  • No values were fetched for this relation

    No values were fetched for this relation

    Hello! I'm using FastApi Admin. It works fine, but in one case I've got a problem. I have ManyToMany Relation in Admin section I can create and delete data, but I can't update data because this error: raise NoValuesFetched( tortoise.exceptions.NoValuesFetched: No values were fetched for this relation, first use .fetch_related())

    Resource: class PageResource(resources.Model): label = "Page" model = Page fields = [ "id", "content", Field(name="type_id", label="Page type", input_=inputs.ForeignKey(model=PageType), ), Field(name="user_id", label="User", input_=inputs.ForeignKey(model=User), ), Field(name="audios", label="Audio", display=displays.InputOnly(), input_=inputs.ManyToMany(model=Audio), ), Field(name="videos", label="Video", display=displays.InputOnly(), input_=inputs.ManyToMany(model=Video), ), ]

    class: class Page(models.Model): """ The Page model """ id = fields.BigIntField(pk=True) content = fields.TextField(null=False) user: fields.ForeignKeyRelation[User] = fields.ForeignKeyField( "models.User", related_name="pages", on_delete=fields.CASCADE) type: fields.ForeignKeyRelation[PageType] = fields.ForeignKeyField( "models.PageType", related_name="pages", on_delete=fields.CASCADE)

    videos: fields.ManyToManyRelation[Video] = fields.ManyToManyField(
        "models.Video", related_name="pages", forward_key="video_id", backward_key="page_id",
        through="page_video"
    )
    
    audios: fields.ManyToManyRelation[Audio] = fields.ManyToManyField(
        "models.Audio", related_name="pages", forward_key="audio_id", backward_key="page_id",
        through="page_audio"
    )
    

    Please help me to manage this problem!

    opened by SantitoSB 8
  • setup.py

    setup.py

    can't execute: python setup.py install @https://fastapi-admin-docs.long2ice.cn/get_start.html#run-example-local

    opened by littleforce163 7
  • Ignore empty inputs if field isn't required

    Ignore empty inputs if field isn't required

    Currently, if a form field is not required and leaves it blank, it can raise an error if an empty value string ("") isn't valid, for example, a UUID field.

    This PR fixes this issue by checking if the field is required and if not, checks if its value is empty. If the value is empty, the field is ignored.

    We need to check what happens with other fields type, where the empty value can be another type than an empty string

    opened by fullonic 0
  • Fix datetime search default values

    Fix datetime search default values

    Currently the default value range for Today when searching by a DateTime field is like: DateTime.now() > DateTime.now() which will return almost of the time 0 values. This PR fixed that by using the beginning and the end of the day as range bounds. Also applies the same logic to other default values: Yesterday, Last 7 days, and Last 30 days

    Example of Today: Before: wrong_dt_format Now: fixed_dt_today

    opened by fullonic 0
  • Render fk values inside resource list

    Render fk values inside resource list

    NOTE: This PR depends on #91

    Before: image

    Now: cat_names

    opened by fullonic 0
  • Improve `update` for fk fields

    Improve `update` for fk fields

    Fix #89

    It allows update foreign-key relations following a similar logic implemented with m2m fields. It will render the same obj.__str__() value inside the dropdown menu

    opened by fullonic 0
  • ComputeField display problem

    ComputeField display problem

    Hi! I'm try to use compute field in fastapi admin. def full_name(self) -> str: return self.first_name + ' ' + self.last_name resource description: ComputeField( name="full_name", label="Full name", display=displays.Display(), input_=inputs.DisplayOnly(), ), But I get None in my admin panel. Can you help me? Versions: fastapi==0.68.0 pydantic==1.8.2 tortoise-orm==0.17.3 fasapi-admin==1.0.3

    opened by SantitoSB 2
  • Lack of documentation. Extra actions creating

    Lack of documentation. Extra actions creating

    I don't know maybe I'm blind, or this project don't have a properly-made documentation at all. It more looks like a school project. For example, I don't know how to extend standard create toolbar action, rewrite needed for me module's method. After researches in SOURCE codes, I saw generated methods for auto-handling, but hadn't seen any examples of custom action creation. So, the question is, is there any normal documentation or so? This project seems to be huge and popular enough, you even provide "sponsor" version, but I don't see documentation for coders at all...

    opened by ftelnov 2
  • Lack of data validation support

    Lack of data validation support

    For me it was surprising that there is no any data validation support. Event DB index error results in 500 error in admin app (i.e. creating one more config with the same key in the example app).

    Initial support for data validation (and corresponding error displaying) is proposed in the PR: https://github.com/fastapi-admin/fastapi-admin/pull/84

    opened by radiophysicist 0
  • Initial data validation support on object create / update

    Initial data validation support on object create / update

    • In recourse model class method for data validation is extracted
    • More error handling added in create / update request handlers
    • Error message rendering added into create / update page templates
    opened by radiophysicist 0
  • Docker config isn't very handy

    Docker config isn't very handy

    The following improvements:

    • Install DB and redis with docker-compose in isolation from the host system
    • Mount fastapi-admin and example sources as volume (no image rebuild on src changes)
    • Autorestart the example application on source changes are proposed in the PR: https://github.com/fastapi-admin/fastapi-admin/pull/82
    opened by radiophysicist 0
Releases(v1.0.3)
Owner
fastapi-admin
A fast admin dashboard based on FastAPI and TortoiseORM with tabler ui, inspired by Django admin
fastapi-admin
An improved django-admin-tools dashboard for Django projects

django-fluent-dashboard The fluent_dashboard module offers a custom admin dashboard, built on top of django-admin-tools (docs). The django-admin-tools

django-fluent 301 Nov 30, 2021
Extends the Django Admin to include a extensible dashboard and navigation menu

django-admin-tools django-admin-tools is a collection of extensions/tools for the default django administration interface, it includes: a full feature

Django Admin Tools 640 Nov 17, 2021
Jet Bridge (Universal) for Jet Admin – API-based Admin Panel Framework for your application

Jet Bridge for Jet Admin – Admin panel framework for your application Description About Jet Admin: https://about.jetadmin.io Live Demo: https://app.je

Jet Admin 1.1k Nov 25, 2021
aiohttp admin is generator for admin interface based on aiohttp

aiohttp admin is generator for admin interface based on aiohttp

Mykhailo Havelia 8 Nov 24, 2021
📱 An extension for Django admin that makes interface mobile-friendly. Merged into Django 2.0

Django Flat Responsive django-flat-responsive is included as part of Django from version 2.0! ?? Use this app if your project is powered by an older D

elky 249 Nov 12, 2021
A Django app for easily adding object tools in the Django admin

Django Object Actions If you've ever tried making admin object tools you may have thought, "why can't this be as easy as making Django Admin Actions?"

Chris Chang 415 Nov 25, 2021
Disable dark mode in Django admin user interface in Django 3.2.x.

Django Non Dark Admin Disable or enable dark mode user interface in Django admin panel (Django==3.2). Installation For install this app run in termina

Artem Galichkin 1 Oct 23, 2021
A cool, modern and responsive django admin application based on bootstrap 5

django-baton A cool, modern and responsive django admin application based on bootstrap 5 Documentation: readthedocs Live Demo Now you can try django-b

Otto srl 506 Nov 23, 2021
Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap.

Xadmin Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap. Liv

差沙 4.6k Nov 24, 2021
Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap.

Xadmin Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap. Liv

差沙 4.6k Nov 29, 2021
Django application and library for importing and exporting data with admin integration.

django-import-export django-import-export is a Django application and library for importing and exporting data with included admin integration. Featur

null 2.3k Dec 1, 2021
Modern responsive template for the Django admin interface with improved functionality. We are proud to announce completely new Jet. Please check out Live Demo

Django JET Modern template for Django admin interface with improved functionality Attention! NEW JET We are proud to announce completely new Jet. Plea

Geex Arts 3.2k Dec 1, 2021
A jazzy skin for the Django Admin-Interface (official repository).

Django Grappelli A jazzy skin for the Django admin interface. Grappelli is a grid-based alternative/extension to the Django administration interface.

Patrick Kranzlmueller 3.1k Nov 25, 2021
A Django admin theme using Twitter Bootstrap. It doesn't need any kind of modification on your side, just add it to the installed apps.

django-admin-bootstrapped A Django admin theme using Bootstrap. It doesn't need any kind of modification on your side, just add it to the installed ap

null 1.6k Nov 18, 2021
django's default admin interface made customizable. popup windows replaced by modals. :mage: :zap:

django-admin-interface django-admin-interface is a modern responsive flat admin interface customizable by the admin itself. Features Beautiful default

Fabio Caccamo 976 Dec 1, 2021
Extendable, adaptable rewrite of django.contrib.admin

django-admin2 One of the most useful parts of django.contrib.admin is the ability to configure various views that touch and alter data. django-admin2

Jazzband 1.1k Nov 26, 2021
Modern theme for Django admin interface

Django Suit Modern theme for Django admin interface. Django Suit is alternative theme/skin/extension for Django administration interface. Project home

Kaspars Sprogis 2.1k Nov 22, 2021
:honey_pot: A fake Django admin login screen page.

django-admin-honeypot django-admin-honeypot is a fake Django admin login screen to log and notify admins of attempted unauthorized access. This app wa

Derek Payton 819 Nov 25, 2021
"Log in as user" for the Django admin.

django-loginas About "Login as user" for the Django admin. loginas supports Python 3 only, as of version 0.4. If you're on 2, use 0.3.6. Installing dj

Stavros Korokithakis 290 Nov 22, 2021