Разработано веб-приложение
This commit is contained in:
1
app/__init__.py
Normal file
1
app/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .main import app
|
31
app/main.py
Normal file
31
app/main.py
Normal file
@ -0,0 +1,31 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import HTMLResponse
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
|
||||
app = FastAPI(
|
||||
openapi_url=None,
|
||||
docs_url=None,
|
||||
redoc_url=None,
|
||||
)
|
||||
|
||||
env = Environment(
|
||||
loader=FileSystemLoader(
|
||||
searchpath='./templates',
|
||||
),
|
||||
enable_async=True,
|
||||
)
|
||||
|
||||
|
||||
@app.get('/')
|
||||
async def function():
|
||||
template = env.get_template('main.jinja2')
|
||||
return HTMLResponse(
|
||||
content=await template.render_async(
|
||||
title='Калькулятор рисков',
|
||||
description='Матрица n×m: игры с природой. Матрица 2×2: аналитический и графический методы.',
|
||||
keywords='калькулятор,теория рисков,теория игр,матрица,игры с природой,критерии,аналитический метод,графический метод',
|
||||
robots='all',
|
||||
),
|
||||
status_code=200,
|
||||
)
|
Reference in New Issue
Block a user