# 项目介绍
<h2 align="center">
FastAPI-Amis-Admin-Nav
</h2>
<p align="center">
<em>FastAPI-Amis-Admin-Nav是一个基于FastAPI-Amis-Admin并且为FastAPI-Amis-Admin提供可视化导航页面管理的拓展库.</em><br/>
</p>
<p align="center">
<a href="https://github.com/amisadmin/fastapi_amis_admin/actions/workflows/pytest.yml" target="_blank">
<img src="https://github.com/amisadmin/fastapi_amis_admin/actions/workflows/pytest.yml/badge.svg" alt="Pytest">
</a>
<a href="https://pypi.org/project/fastapi_amis_admin_nav" target="_blank">
<img src="https://badgen.net/pypi/v/fastapi-amis-admin-nav?color=blue" alt="Package version">
</a>
<a href="https://pepy.tech/project/fastapi-amis-admin-nav" target="_blank">
<img src="https://pepy.tech/badge/fastapi-amis-admin-nav" alt="Downloads">
</a>
<a href="https://gitter.im/amisadmin/fastapi-amis-admin">
<img src="https://badges.gitter.im/amisadmin/fastapi-amis-admin.svg" alt="Chat on Gitter"/>
</a>
<a href="https://jq.qq.com/?_wv=1027&k=U4Dv6x8W" target="_blank">
<img src="https://badgen.net/badge/qq%E7%BE%A4/229036692/orange" alt="229036692">
</a>
</p>
<p align="center">
<a href="https://github.com/amisadmin/fastapi_amis_admin_nav" target="_blank">源码</a>
·
<a href="http://user-auth.demo.amis.work/" target="_blank">在线演示</a>
·
<a href="http://docs.amis.work" target="_blank">文档</a>
·
<a href="http://docs.gh.amis.work" target="_blank">文档打不开?</a>
</p>
------
`fastapi-amis-admin-nav`是一个基于FastAPI-Amis-Admin并且为FastAPI-Amis-Admin提供可视化导航页面管理的拓展库.
## 安装
```bash
pip install fastapi-amis-admin-nav
```
## 简单示例
```python
from fastapi import FastAPI
from fastapi_amis_admin.admin.settings import Settings
from fastapi_amis_admin.admin.site import AdminSite
from fastapi_amis_admin_nav.admin import NavPageAdmin
from sqlmodel import SQLModel
# 创建FastAPI应用
app = FastAPI()
# 创建AdminSite实例
site = AdminSite(settings=Settings(database_url_async='sqlite+aiosqlite:///amisadmin.db'))
# 注册导航页面管理
site.register_admin(NavPageAdmin)
# 挂载后台管理系统
site.mount_app(app)
# 创建初始化数据库表
@app.on_event("startup")
async def startup():
# 创建数据库表
await site.db.async_run_sync(SQLModel.metadata.create_all, is_session=False)
# 运行后台管理系统启动事件
await site.fastapi.router.startup()
if __name__ == '__main__':
import uvicorn
uvicorn.run(app, debug=True)
```
## 界面预览
- Open `http://127.0.0.1:8000/admin/` in your browser:
![ModelAdmin](https://s2.loli.net/2022/03/20/ItgFYGUONm1jCz5.png)
## 许可协议
- `fastapi-amis-admin`基于`Apache2.0`开源免费使用,可以免费用于商业用途,但请在展示界面中明确显示关于FastAPI-Amis-Admin的版权信息.
Raw data
{
"_id": null,
"home_page": "",
"name": "fastapi-amis-admin-nav",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "Atomi <1456417373@qq.com>",
"keywords": "fastapi,fastapi-user-auth,fastapi-amis-admin,fastapi-amis-admin-nav",
"author": "",
"author_email": "Atomi <1456417373@qq.com>",
"download_url": "https://files.pythonhosted.org/packages/60/59/afee3f3280dba2779ebc1759283b21464ecb62104755d41d34d49a4873a1/fastapi_amis_admin_nav-0.0.4.tar.gz",
"platform": null,
"description": "# \u9879\u76ee\u4ecb\u7ecd\n\n<h2 align=\"center\">\n FastAPI-Amis-Admin-Nav\n</h2>\n<p align=\"center\">\n <em>FastAPI-Amis-Admin-Nav\u662f\u4e00\u4e2a\u57fa\u4e8eFastAPI-Amis-Admin\u5e76\u4e14\u4e3aFastAPI-Amis-Admin\u63d0\u4f9b\u53ef\u89c6\u5316\u5bfc\u822a\u9875\u9762\u7ba1\u7406\u7684\u62d3\u5c55\u5e93.</em><br/>\n\n</p>\n<p align=\"center\">\n <a href=\"https://github.com/amisadmin/fastapi_amis_admin/actions/workflows/pytest.yml\" target=\"_blank\">\n <img src=\"https://github.com/amisadmin/fastapi_amis_admin/actions/workflows/pytest.yml/badge.svg\" alt=\"Pytest\">\n </a>\n <a href=\"https://pypi.org/project/fastapi_amis_admin_nav\" target=\"_blank\">\n <img src=\"https://badgen.net/pypi/v/fastapi-amis-admin-nav?color=blue\" alt=\"Package version\">\n </a>\n <a href=\"https://pepy.tech/project/fastapi-amis-admin-nav\" target=\"_blank\">\n <img src=\"https://pepy.tech/badge/fastapi-amis-admin-nav\" alt=\"Downloads\">\n </a>\n <a href=\"https://gitter.im/amisadmin/fastapi-amis-admin\">\n <img src=\"https://badges.gitter.im/amisadmin/fastapi-amis-admin.svg\" alt=\"Chat on Gitter\"/>\n </a>\n <a href=\"https://jq.qq.com/?_wv=1027&k=U4Dv6x8W\" target=\"_blank\">\n <img src=\"https://badgen.net/badge/qq%E7%BE%A4/229036692/orange\" alt=\"229036692\">\n </a>\n</p>\n<p align=\"center\">\n <a href=\"https://github.com/amisadmin/fastapi_amis_admin_nav\" target=\"_blank\">\u6e90\u7801</a>\n \u00b7\n <a href=\"http://user-auth.demo.amis.work/\" target=\"_blank\">\u5728\u7ebf\u6f14\u793a</a>\n \u00b7\n <a href=\"http://docs.amis.work\" target=\"_blank\">\u6587\u6863</a>\n \u00b7\n <a href=\"http://docs.gh.amis.work\" target=\"_blank\">\u6587\u6863\u6253\u4e0d\u5f00\uff1f</a>\n</p>\n\n------\n\n`fastapi-amis-admin-nav`\u662f\u4e00\u4e2a\u57fa\u4e8eFastAPI-Amis-Admin\u5e76\u4e14\u4e3aFastAPI-Amis-Admin\u63d0\u4f9b\u53ef\u89c6\u5316\u5bfc\u822a\u9875\u9762\u7ba1\u7406\u7684\u62d3\u5c55\u5e93.\n\n## \u5b89\u88c5\n\n```bash\npip install fastapi-amis-admin-nav\n```\n\n## \u7b80\u5355\u793a\u4f8b\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi_amis_admin.admin.settings import Settings\nfrom fastapi_amis_admin.admin.site import AdminSite\nfrom fastapi_amis_admin_nav.admin import NavPageAdmin\nfrom sqlmodel import SQLModel\n\n# \u521b\u5efaFastAPI\u5e94\u7528\napp = FastAPI()\n\n# \u521b\u5efaAdminSite\u5b9e\u4f8b\nsite = AdminSite(settings=Settings(database_url_async='sqlite+aiosqlite:///amisadmin.db'))\n\n# \u6ce8\u518c\u5bfc\u822a\u9875\u9762\u7ba1\u7406\nsite.register_admin(NavPageAdmin)\n\n# \u6302\u8f7d\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\nsite.mount_app(app)\n\n\n# \u521b\u5efa\u521d\u59cb\u5316\u6570\u636e\u5e93\u8868\n@app.on_event(\"startup\")\nasync def startup():\n # \u521b\u5efa\u6570\u636e\u5e93\u8868\n await site.db.async_run_sync(SQLModel.metadata.create_all, is_session=False)\n # \u8fd0\u884c\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf\u542f\u52a8\u4e8b\u4ef6\n await site.fastapi.router.startup()\n\n\nif __name__ == '__main__':\n import uvicorn\n\n uvicorn.run(app, debug=True)\n\n```\n\n\n## \u754c\u9762\u9884\u89c8\n\n- Open `http://127.0.0.1:8000/admin/` in your browser:\n\n![ModelAdmin](https://s2.loli.net/2022/03/20/ItgFYGUONm1jCz5.png)\n\n\n## \u8bb8\u53ef\u534f\u8bae\n\n- `fastapi-amis-admin`\u57fa\u4e8e`Apache2.0`\u5f00\u6e90\u514d\u8d39\u4f7f\u7528\uff0c\u53ef\u4ee5\u514d\u8d39\u7528\u4e8e\u5546\u4e1a\u7528\u9014\uff0c\u4f46\u8bf7\u5728\u5c55\u793a\u754c\u9762\u4e2d\u660e\u786e\u663e\u793a\u5173\u4e8eFastAPI-Amis-Admin\u7684\u7248\u6743\u4fe1\u606f.\n\n",
"bugtrack_url": null,
"license": "",
"summary": "FastAPI-Amis-Admin-Nav\u662f\u4e00\u4e2a\u57fa\u4e8eFastAPI-Amis-Admin\u5e76\u4e14\u4e3aFastAPI-Amis-Admin\u63d0\u4f9b\u53ef\u89c6\u5316\u5bfc\u822a\u9875\u9762\u7ba1\u7406\u7684\u62d3\u5c55\u5e93.",
"version": "0.0.4",
"project_urls": {
"Documentation": "http://docs.amis.work/",
"FastAPI-Amis-Admin": "https://github.com/amisadmin/fastapi_amis_admin",
"Source": "https://github.com/amisadmin/fastapi_amis_admin_nav"
},
"split_keywords": [
"fastapi",
"fastapi-user-auth",
"fastapi-amis-admin",
"fastapi-amis-admin-nav"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d2ac9a92374a6a8eda1f915047490347677ba4f93b82373418de92e0691f3ca1",
"md5": "b4721ff68aa69689c236f95f080c0d2d",
"sha256": "e721ca3889cdc3447e1837aa09c893d278acba251960e4ab3cd4aac49edf2d08"
},
"downloads": -1,
"filename": "fastapi_amis_admin_nav-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b4721ff68aa69689c236f95f080c0d2d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9268,
"upload_time": "2023-05-17T07:13:24",
"upload_time_iso_8601": "2023-05-17T07:13:24.161838Z",
"url": "https://files.pythonhosted.org/packages/d2/ac/9a92374a6a8eda1f915047490347677ba4f93b82373418de92e0691f3ca1/fastapi_amis_admin_nav-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6059afee3f3280dba2779ebc1759283b21464ecb62104755d41d34d49a4873a1",
"md5": "129b48c2bc33cf5c46e217e843fee6e2",
"sha256": "14e2db3c5246579a19be1c7dc776e51e6ac2301f731c11e45d5e19539c8f0f54"
},
"downloads": -1,
"filename": "fastapi_amis_admin_nav-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "129b48c2bc33cf5c46e217e843fee6e2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 9027,
"upload_time": "2023-05-17T07:13:26",
"upload_time_iso_8601": "2023-05-17T07:13:26.056299Z",
"url": "https://files.pythonhosted.org/packages/60/59/afee3f3280dba2779ebc1759283b21464ecb62104755d41d34d49a4873a1/fastapi_amis_admin_nav-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-17 07:13:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "amisadmin",
"github_project": "fastapi_amis_admin",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "fastapi-amis-admin-nav"
}