diff --git a/404.html b/404.html index 5f81bbe..8af0a72 100755 --- a/404.html +++ b/404.html @@ -6,7 +6,7 @@ - + diff --git a/index.html b/index.html index 2e50881..fc64cd9 100755 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ - + @@ -798,9 +798,7 @@
FastTower — это молодая и легкая библиотека основанная на FastAPI для быстрого создания серверных приложений на Python с -Django-like -структурой.
+FastTower — это молодой фреймворк основанный на FastAPI для быстрого создания серверных приложений с Django-like структурой.
Для этого создайте файл в папке app(appexample) commands.py +
Для этого создайте файл в папке app(appexample) commands.py
import typer
example_commands = typer.Typer(name="appexample", help="Example commands")
@@ -1067,12 +1065,12 @@ Создание новых командdef hello_world():
print("Hello World!")
Вот и все её можно запустить!
tower appexample hello-world
Hello World!
Более детально про Typer
FastTower \u2014 \u044d\u0442\u043e \u043c\u043e\u043b\u043e\u0434\u0430\u044f \u0438 \u043b\u0435\u0433\u043a\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 FastAPI \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 Python \u0441 Django-like \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439.
"},{"location":"#features","title":"Features","text":"\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e tortoise orm \u0438 \u0430\u0434\u043c\u0438\u043d \u043f\u0430\u043d\u0435\u043b\u044c \u0434\u043b\u044f \u043d\u0435\u0435, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0431\u0434 \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0438\u0440\u0443\u044f FastTower app \u0432 asgi.py \u0444\u0430\u0439\u043b\u0435
\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440...\u043d\u0430 github
"},{"location":"#_2","title":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430","text":"pip install fasttower[tortoise]\n
\u0422\u0430\u043a \u0436\u0435 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f aerich, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043a
pip install git+https://github.com/pysashapy/taerich.git@0.0.1\n
"},{"location":"#_3","title":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430","text":"\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435
tower g p example\n
\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c Django-like \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440
python manage.py run\n
\u0418\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c... uvicorn example.asgi:app \n
"},{"location":"#_4","title":"\u041e\u0431\u0437\u043e\u0440","text":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0440\u043e\u043b\u044c manage.py \u0444\u0430\u0439\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c env FASTTOWER_SETTINGS_MODULE \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u044e \u043f\u0443\u0442\u044c \u0434\u043e \u0432\u0430\u0448\u0435\u0433\u043e settings.py \u0444\u0430\u0439\u043b\u0430(* example.settings). \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0435 \u0441\u0430\u043c\u0438 \u0438 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 *tower. \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 **tower, \u043d\u043e \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c python manage.py
\u0417\u0430\u043f\u0443\u0441\u043a \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 env...tower run\n
"},{"location":"#_5","title":"\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430","text":""},{"location":"#asgipy","title":"asgi.py","text":"FastTower - \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 FastAPI class.
\"\"\"\nASGI config for example project.\n\nIt exposes the ASGI callable as a module-level variable named ``application``.\n\"\"\"\n\nimport os\n\nfrom fasttower.utils import setup\n\nos.environ.setdefault(\"FASTTOWER_SETTINGS_MODULE\", \"example.settings\")\nsetup()\n\nfrom fasttower.server import FastTower\n\nfrom example.routers import router\n\napp = FastTower(title=\"FastTower API Documentation\")\n\napp.include_router(router)\n
\u0415\u0441\u043b\u0438 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d tortoise... \u0423\u0431\u0435\u0440\u0438\u0442\u0435 lifespan
lifespan=lifespans([tortoise_lifespan])\n
"},{"location":"#settingspy","title":"settings.py","text":"\u0412\u043f\u0440\u0430\u0432\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 Django?
\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043e\u043b\u044f: INSTALLED_APPS, MIDDLEWARE, USER_MODEL(\u0422\u043e\u043b\u044c\u043a\u043e tortoise!)
from pathlib import Path\n\nBASE_DIR = Path(__file__).resolve().parent.parent\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = \"niJEjVCDfqHI_Fke_oUDVgcqkfWfW8ZEoUT_OQxVKco\"\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\n\nALLOWED_HOSTS = [\"*\"]\n\nINSTALLED_APPS = [\n 'fasttower.apps.taerich',\n 'fasttower.auth',\n]\n\nMIDDLEWARE = [\n [\"fastapi.middleware.trustedhost:TrustedHostMiddleware\", {\"allowed_hosts\": ALLOWED_HOSTS}],\n [\"fastapi.middleware.gzip:GZipMiddleware\", {\"minimum_size\": 1000, \"compresslevel\": 5}],\n]\nif DEBUG:\n MIDDLEWARE += [\"debug_toolbar.middleware:DebugToolbarMiddleware\"],\n\nUSER_MODEL = 'fasttower.auth.models:BaseUser'\n\nASGI = \"example.asgi:app\"\n\nLANGUAGE_CODE = \"en-us\"\nTIME_ZONE = \"UTC\"\nUSE_TZ = True\n\n# Database\nDATABASES = {\n \"connections\": {\n \"default\": {\n \"engine\": \"tortoise.backends.sqlite\",\n \"credentials\": {\n \"file_path\": str(BASE_DIR / \"db.sqlite3\"),\n }\n },\n },\n}\n\n# https://github.com/fastapi-admin/fastapi-admin\nADMIN_PANEL_REDIS = 'redis://localhost:6379/0'\n
"},{"location":"#installed_apps","title":"INSTALLED_APPS","text":"\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0435\u0433\u043e \u0432 INSTALLED_APPS! \u0418\u043d\u0430\u0447\u0435 \u0443 FastTower \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u043e\u0434\u0435\u043b\u044f\u043c \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f
"},{"location":"#middleware","title":"MIDDLEWARE","text":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 starlette \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 middleware!
\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 MIDDLEWARE
MIDDLEWARE = [\n [\"fastapi.middleware.trustedhost:TrustedHostMiddleware\", {\"allowed_hosts\": ALLOWED_HOSTS}],\n [\"fastapi.middleware.gzip:GZipMiddleware\", {\"minimum_size\": 1000, \"compresslevel\": 5}],\n ...\n [\"path:class\", {...kwargs}],\n]\n
"},{"location":"#routerspy","title":"routers.py","text":"\u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 APPs
from fasttower.routers import APIRouter\n\nrouter = APIRouter(prefix=\"/api/v1\")\nrouter.include_router(APP_ROUTER, prefix='/app')\n
"},{"location":"#_6","title":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f","text":"\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435
tower g a appexample\n
\u041f\u043e\u0441\u043b\u0435 \u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 settings.py -> INSTALLED_APPS
INSTALLED_APPS = [\n 'fasttower.apps.taerich',\n 'fasttower.auth',\n ...\n 'appexample',\n]\n
\u041a\u0430\u0436\u0434\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 config.py, models.py, admin.py, serializers.py, routers.py \u0438 views.py
"},{"location":"#models","title":"Models","text":"\u041e\u0441\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 tortoise, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0439!
from fasttower.db import models\n\n\nclass FastTowerModel(models.Model):\n say = models.CharField(max_length=100, default=\"Hello World!\")\n
"},{"location":"#admin","title":"Admin","text":"\u0422\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d \u043f\u0430\u043d\u0435\u043b\u0438
from fastapi_admin.resources import Model, Dropdown\nfrom fasttower import admin\n\nfrom appexample import models\n\n\n@admin.site.app.register\nclass AppexampleTabMenu(Dropdown):\n label = \"Appexamples\"\n icon = \"fas fa-bars\"\n resources = []\n title = \"Appexamples\"\n
"},{"location":"#views","title":"Views","text":"\u0422\u0443\u0442 \u0432\u0441\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e FastAPI, \u0441\u043a\u043e\u0440\u043e \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f mixins \u043a\u0430\u043a \u0432 Django \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 CRUD \u0437\u0430\u0434\u0430\u0447!
from appexample.models import FastTowerModel\n\nfrom fasttower.routers import APIRouter\n\nrouter = APIRouter()\n\n\n@router.get(\"/\")\nasync def say():\n return await FastTowerModel().create()\n
\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 appexample.routers, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0432 example.routers
"},{"location":"#admin-panel","title":"Admin panel","text":"\u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Redis
\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432 settings.py
ADMIN_PANEL_REDIS = 'redis://localhost:6379/0'\n
\u0410 \u0442\u0430\u043a \u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 asgi.py
from fasttower.admin.site import app as admin_app, lifespan_admin\nfrom fasttower.db import lifespan\n\napp = FastTower(title=\"FastTower API Documentation\", lifespan=lifespans([lifespan, lifespan_admin]))\n\napp.mount('/admin', admin_app)\n
\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434... \"\"\"\nASGI config for example project.\n\nIt exposes the ASGI callable as a module-level variable named ``application``.\n\"\"\"\n\nimport os\n\nfrom fasttower.utils import setup, lifespans\n\nos.environ.setdefault(\"FASTTOWER_SETTINGS_MODULE\", \"example.settings\")\nsetup()\n\nfrom fasttower.server import FastTower\n\nfrom example.routers import router\nfrom fasttower.admin.site import app as admin_app, lifespan_admin\nfrom fasttower.db import lifespan\n\napp = FastTower(title=\"FastTower API Documentation\", lifespan=lifespans([lifespan, lifespan_admin]))\n\napp.mount('/admin', admin_app)\n\napp.include_router(router)\n
"},{"location":"#commands","title":"Commands","text":"\u0421\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0438\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0443
tower --help\n
Usage: tower [OPTIONS] COMMAND [ARGS]... \n\n\u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 --install-completion Install completion for the current shell. \u2502\n\u2502 --show-completion Show completion for the current shell, to copy it or customize the installation. \u2502\n\u2502 --help Show this message and exit. \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500 Commands \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 db Database commands \u2502\n\u2502 g Generate project structures and app components for FastTower. \u2502\n\u2502 run \u0417\u0430\u043f\u0443\u0441\u043a FastTower \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u2502\n\u2502 shell \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443. \u2502\n\u2502 superuser Create a superuser. \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n
"},{"location":"#_7","title":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434","text":"\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 app(appexample) commands.py
import typer\n\nexample_commands = typer.Typer(name=\"appexample\", help=\"Example commands\")\n\n\n@example_commands.command()\ndef hello_world():\n print(\"Hello World!\")\n
\u0412\u043e\u0442 \u0438 \u0432\u0441\u0435 \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c! tower appexample hello-world\n
Hello World!\n
\u0411\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e Typer"},{"location":"#_8","title":"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442...","text":""},{"location":"installation/","title":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430","text":"\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 pip:
pip install fasttower\n
"}]}
\ No newline at end of file
+{"config":{"lang":["ru"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"FastTower","text":"FastTower \u2014 \u044d\u0442\u043e \u043c\u043e\u043b\u043e\u0434\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 FastAPI \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 Django-like \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439.
"},{"location":"#features","title":"Features","text":"\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e tortoise orm \u0438 \u0430\u0434\u043c\u0438\u043d \u043f\u0430\u043d\u0435\u043b\u044c \u0434\u043b\u044f \u043d\u0435\u0435, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0431\u0434 \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0438\u0440\u0443\u044f FastTower app \u0432 asgi.py \u0444\u0430\u0439\u043b\u0435
\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440...\u043d\u0430 github
"},{"location":"#_2","title":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430","text":"pip install fasttower[tortoise]\n
\u0422\u0430\u043a \u0436\u0435 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f aerich, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043a
pip install git+https://github.com/pysashapy/taerich.git@0.0.1\n
"},{"location":"#_3","title":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430","text":"\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435
tower g p example\n
\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c Django-like \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440
python manage.py run\n
\u0418\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c... uvicorn example.asgi:app \n
"},{"location":"#_4","title":"\u041e\u0431\u0437\u043e\u0440","text":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0440\u043e\u043b\u044c manage.py \u0444\u0430\u0439\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c env FASTTOWER_SETTINGS_MODULE \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u044e \u043f\u0443\u0442\u044c \u0434\u043e \u0432\u0430\u0448\u0435\u0433\u043e settings.py \u0444\u0430\u0439\u043b\u0430(* example.settings). \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0435 \u0441\u0430\u043c\u0438 \u0438 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 *tower. \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 **tower, \u043d\u043e \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c python manage.py
\u0417\u0430\u043f\u0443\u0441\u043a \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 env...tower run\n
"},{"location":"#_5","title":"\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430","text":""},{"location":"#asgipy","title":"asgi.py","text":"FastTower - \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 FastAPI class.
\"\"\"\nASGI config for example project.\n\nIt exposes the ASGI callable as a module-level variable named ``application``.\n\"\"\"\n\nimport os\n\nfrom fasttower.utils import setup\n\nos.environ.setdefault(\"FASTTOWER_SETTINGS_MODULE\", \"example.settings\")\nsetup()\n\nfrom fasttower.server import FastTower\n\nfrom example.routers import router\n\napp = FastTower(title=\"FastTower API Documentation\")\n\napp.include_router(router)\n
\u0415\u0441\u043b\u0438 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d tortoise... \u0423\u0431\u0435\u0440\u0438\u0442\u0435 lifespan
lifespan=lifespans([tortoise_lifespan])\n
"},{"location":"#settingspy","title":"settings.py","text":"\u0412\u043f\u0440\u0430\u0432\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 Django?
\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043e\u043b\u044f: INSTALLED_APPS, MIDDLEWARE, USER_MODEL(\u0422\u043e\u043b\u044c\u043a\u043e tortoise!)
from pathlib import Path\n\nBASE_DIR = Path(__file__).resolve().parent.parent\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = \"niJEjVCDfqHI_Fke_oUDVgcqkfWfW8ZEoUT_OQxVKco\"\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\n\nALLOWED_HOSTS = [\"*\"]\n\nINSTALLED_APPS = [\n 'fasttower.apps.taerich',\n 'fasttower.auth',\n]\n\nMIDDLEWARE = [\n [\"fastapi.middleware.trustedhost:TrustedHostMiddleware\", {\"allowed_hosts\": ALLOWED_HOSTS}],\n [\"fastapi.middleware.gzip:GZipMiddleware\", {\"minimum_size\": 1000, \"compresslevel\": 5}],\n]\nif DEBUG:\n MIDDLEWARE += [\"debug_toolbar.middleware:DebugToolbarMiddleware\"],\n\nUSER_MODEL = 'fasttower.auth.models:BaseUser'\n\nASGI = \"example.asgi:app\"\n\nLANGUAGE_CODE = \"en-us\"\nTIME_ZONE = \"UTC\"\nUSE_TZ = True\n\n# Database\nDATABASES = {\n \"connections\": {\n \"default\": {\n \"engine\": \"tortoise.backends.sqlite\",\n \"credentials\": {\n \"file_path\": str(BASE_DIR / \"db.sqlite3\"),\n }\n },\n },\n}\n\n# https://github.com/fastapi-admin/fastapi-admin\nADMIN_PANEL_REDIS = 'redis://localhost:6379/0'\n
"},{"location":"#installed_apps","title":"INSTALLED_APPS","text":"\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0435\u0433\u043e \u0432 INSTALLED_APPS! \u0418\u043d\u0430\u0447\u0435 \u0443 FastTower \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u043e\u0434\u0435\u043b\u044f\u043c \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f
"},{"location":"#middleware","title":"MIDDLEWARE","text":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 starlette \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 middleware!
\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 MIDDLEWARE
MIDDLEWARE = [\n [\"fastapi.middleware.trustedhost:TrustedHostMiddleware\", {\"allowed_hosts\": ALLOWED_HOSTS}],\n [\"fastapi.middleware.gzip:GZipMiddleware\", {\"minimum_size\": 1000, \"compresslevel\": 5}],\n ...\n [\"path:class\", {...kwargs}],\n]\n
"},{"location":"#routerspy","title":"routers.py","text":"\u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 APPs
from fasttower.routers import APIRouter\n\nrouter = APIRouter(prefix=\"/api/v1\")\nrouter.include_router(APP_ROUTER, prefix='/app')\n
"},{"location":"#_6","title":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f","text":"\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435
tower g a appexample\n
\u041f\u043e\u0441\u043b\u0435 \u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 settings.py -> INSTALLED_APPS
INSTALLED_APPS = [\n 'fasttower.apps.taerich',\n 'fasttower.auth',\n ...\n 'appexample',\n]\n
\u041a\u0430\u0436\u0434\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 config.py, models.py, admin.py, serializers.py, routers.py \u0438 views.py
"},{"location":"#models","title":"Models","text":"\u041e\u0441\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 tortoise, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0439!
from fasttower.db import models\n\n\nclass FastTowerModel(models.Model):\n say = models.CharField(max_length=100, default=\"Hello World!\")\n
"},{"location":"#admin","title":"Admin","text":"\u0422\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d \u043f\u0430\u043d\u0435\u043b\u0438
from fastapi_admin.resources import Model, Dropdown\nfrom fasttower import admin\n\nfrom appexample import models\n\n\n@admin.site.app.register\nclass AppexampleTabMenu(Dropdown):\n label = \"Appexamples\"\n icon = \"fas fa-bars\"\n resources = []\n title = \"Appexamples\"\n
"},{"location":"#views","title":"Views","text":"\u0422\u0443\u0442 \u0432\u0441\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e FastAPI, \u0441\u043a\u043e\u0440\u043e \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f mixins \u043a\u0430\u043a \u0432 Django \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 CRUD \u0437\u0430\u0434\u0430\u0447!
from appexample.models import FastTowerModel\n\nfrom fasttower.routers import APIRouter\n\nrouter = APIRouter()\n\n\n@router.get(\"/\")\nasync def say():\n return await FastTowerModel().create()\n
\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 appexample.routers, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0432 example.routers
"},{"location":"#admin-panel","title":"Admin panel","text":"\u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Redis
\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432 settings.py
ADMIN_PANEL_REDIS = 'redis://localhost:6379/0'\n
\u0410 \u0442\u0430\u043a \u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 asgi.py
from fasttower.admin.site import app as admin_app, lifespan_admin\nfrom fasttower.db import lifespan\n\napp = FastTower(title=\"FastTower API Documentation\", lifespan=lifespans([lifespan, lifespan_admin]))\n\napp.mount('/admin', admin_app)\n
\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434... \"\"\"\nASGI config for example project.\n\nIt exposes the ASGI callable as a module-level variable named ``application``.\n\"\"\"\n\nimport os\n\nfrom fasttower.utils import setup, lifespans\n\nos.environ.setdefault(\"FASTTOWER_SETTINGS_MODULE\", \"example.settings\")\nsetup()\n\nfrom fasttower.server import FastTower\n\nfrom example.routers import router\nfrom fasttower.admin.site import app as admin_app, lifespan_admin\nfrom fasttower.db import lifespan\n\napp = FastTower(title=\"FastTower API Documentation\", lifespan=lifespans([lifespan, lifespan_admin]))\n\napp.mount('/admin', admin_app)\n\napp.include_router(router)\n
"},{"location":"#commands","title":"Commands","text":"\u0421\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0438\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0443
tower --help\n
Usage: tower [OPTIONS] COMMAND [ARGS]... \n\n\u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 --install-completion Install completion for the current shell. \u2502\n\u2502 --show-completion Show completion for the current shell, to copy it or customize the installation. \u2502\n\u2502 --help Show this message and exit. \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500 Commands \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 db Database commands \u2502\n\u2502 g Generate project structures and app components for FastTower. \u2502\n\u2502 run \u0417\u0430\u043f\u0443\u0441\u043a FastTower \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u2502\n\u2502 shell \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443. \u2502\n\u2502 superuser Create a superuser. \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n
"},{"location":"#_7","title":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434","text":"\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 app(appexample) commands.py
import typer\n\nexample_commands = typer.Typer(name=\"appexample\", help=\"Example commands\")\n\n\n@example_commands.command()\ndef hello_world():\n print(\"Hello World!\")\n
\u0412\u043e\u0442 \u0438 \u0432\u0441\u0435 \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c!
tower appexample hello-world\n
Hello World!\n
\u0411\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e Typer
"},{"location":"#_8","title":"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442...","text":""},{"location":"installation/","title":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430","text":"\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 pip:
pip install fasttower\n
"}]}
\ No newline at end of file