# 项目介绍
<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/3f/75/474e8888dfa261bbe82f609317814217f746067e0a1fd258c85511e680b2/fastapi_amis_admin_nav-0.1.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.1.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": "a30d554eee07747b34d0e4f3fae7b76ca48bb36eb9aacd35789a2408b497e87e",
"md5": "212a97ef3802ec86fd184e69331f85a5",
"sha256": "2ae2cf2bb13cb84b850a91d130010d2d3e7afaca9ef3a38fcc0c58458af0ebdf"
},
"downloads": -1,
"filename": "fastapi_amis_admin_nav-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "212a97ef3802ec86fd184e69331f85a5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9765,
"upload_time": "2024-01-05T07:51:04",
"upload_time_iso_8601": "2024-01-05T07:51:04.157538Z",
"url": "https://files.pythonhosted.org/packages/a3/0d/554eee07747b34d0e4f3fae7b76ca48bb36eb9aacd35789a2408b497e87e/fastapi_amis_admin_nav-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3f75474e8888dfa261bbe82f609317814217f746067e0a1fd258c85511e680b2",
"md5": "e90ecf86b0ebd2db352326fdbfd38d97",
"sha256": "5acb9d903d425702abb6eda33778784955cb8b88ed4eec5e1ad5fb9aecb11942"
},
"downloads": -1,
"filename": "fastapi_amis_admin_nav-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "e90ecf86b0ebd2db352326fdbfd38d97",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 9462,
"upload_time": "2024-01-05T07:51:05",
"upload_time_iso_8601": "2024-01-05T07:51:05.945441Z",
"url": "https://files.pythonhosted.org/packages/3f/75/474e8888dfa261bbe82f609317814217f746067e0a1fd258c85511e680b2/fastapi_amis_admin_nav-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-05 07:51:05",
"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"
}