Merge branch 'lon_students' into lon_students_merge_code_test
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
from fastapi import FastAPI
|
||||||
|
from students.api.students_api import students_api
|
||||||
|
from students.databases import *
|
||||||
|
from students.model import students_model
|
||||||
|
from contextlib import asynccontextmanager
|
||||||
|
|
||||||
|
@asynccontextmanager
|
||||||
|
async def lifespan(app: FastAPI):
|
||||||
|
Base.metadata.create_all(engine1)
|
||||||
|
yield
|
||||||
|
engine1.dispose()
|
||||||
|
|
||||||
|
app = FastAPI(title="学生管理系统",lifespan=lifespan) # 这里必须把上面写的加上
|
||||||
|
|
||||||
|
app.include_router(students_api,tags=["students"])
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print("Hello from student-manage-system!")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import uvicorn
|
||||||
|
uvicorn.run("main:app", host="0.0.0.0", port=51000)
|
||||||
|
|
||||||
|
"""students api
|
||||||
|
IPv4 地址 . . . . . . . . . . . . : 192.168.6.40
|
||||||
|
默认网关. . . . . . . . . . . . . : 192.168.6.1
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user