Fix build application from terminal

This commit is contained in:
shadowik 2024-10-20 15:48:17 +04:00
parent 4f659b1149
commit e29917fbca
4 changed files with 18 additions and 8 deletions

View File

@ -21,7 +21,12 @@
pip install -r requirements.txt
```
4. Start FastAPI process
4. Enter src directory
```zsh
fastapi dev main.py
cd src
```
5. Start FastAPI process
```zsh
uvicorn main:app --reload
```

View File

@ -1,8 +1,8 @@
from sqlalchemy import select
from .database import session_maker
from .models import Weather
from .schemas import SWeatherInfo
from data.database import session_maker
from data.models import Weather
from data.schemas import SWeatherInfo
class WeatherRepository:

View File

@ -1,3 +1,5 @@
import sys
from pathlib import Path
from fastapi import FastAPI

View File

@ -1,3 +1,4 @@
import sys
from http import HTTPStatus
from pathlib import Path
from typing import Annotated
@ -8,9 +9,11 @@ from fastapi.responses import FileResponse
from data.repository import WeatherRepository
from data.schemas import SFlorisInputParams, SFlorisOutputData, SWeatherInfo
from FlorisULSTU import FlorisULSTU
FLORIS_IMAGES_PATH = Path("public/floris")
sys.path.append(str(Path(__file__).parent.parent.parent))
from floris_module.src import FlorisULSTU
FLORIS_IMAGES_PATH = Path(__file__).parent.parent.parent / "public" / "floris"
router = APIRouter(
prefix="/api/floris",