Giter Site home page Giter Site logo

oneincloud / fastapi-vue-admin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from imhsz/fastapi-vue-admin

0.0 0.0 0.0 387 KB

使用fastapi做后端,vue-element-admin作为前端的后台管理系统

License: MIT License

Shell 0.02% JavaScript 37.69% Python 21.72% HTML 0.50% Vue 34.49% SCSS 5.59%

fastapi-vue-admin's Introduction

fastapi-vue-admin

使用fastapi和vue-element-admin构建的管理后台

目前配置直接写在配置文件中,生产环境推荐使用Nacos作为配置中心

项目初始化

pip install -r requirements.txt -i  https://pypi.tuna.tsinghua.edu.cn/simple
windows下可能需要安装如下软件:
Micorosoft visio c++
https://go.microsoft.com/fwlink/?LinkId=691126
安装cryptography openssl报错:
下载安装https://slproweb.com/products/Win32OpenSSL.html
将安装后目录的include下的openssl目录复制到python的include目录下
将安装后目录中lib下的libcrypto.lib和libssl.lib复制到python的libs目录下
在安装mysqlclient时会出现报错,解决方法如下:
https://blog.csdn.net/alvechen/article/details/95040255

数据库初始化

数据库创建一个fast库,编码格式utf8mb4
数据库更新使用alembic
alembic init alembic
修改alembic的ini文件,将链接地址改为正确的
修改alembic env文件,添加如下内容
import os
import sys
# 把当前项目路径加入到path中
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from models.base import Base
target_metadata = Base.metadata
注释掉 target_metadata = None

生成执行文件
alembic revision --autogenerate -m "first commit"
alembic upgrade head

项目启动

python main.py

初始化数据

表结构创建完成后执行目录下的init.sql文件插入初始数据

查看项目swagger

访问http://localhost:端口号/docs即可

swagger

启动前端

cd front
npm install --registry=https://registry.npm.taobao.org
npm run dev

登陆页面

初始账户密码:admin/123456 login

主页

dashboard

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.