-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* default routes /docs, /redoc and /openapi.json work. * Tidy Up 1 (#3) readme is updated with an instruction how to start * gitignore is updated. * Readme is updated with dev's information about maintenance. mypy is run. * excluding 3.11 due to error with installing of uvloop battery. longintrepr.h: No such file or directory * excluding 3.10 due to error with installing of uvloop battery. error: command '/usr/bin/gcc' failed with exit code 1 || Failed building wheel for uvloop * requirements are updated.
- Loading branch information
Showing
8 changed files
with
154 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
|
||
.idea/ | ||
venv/ | ||
__pycache__/ | ||
.mypy_cache/ | ||
*.pyc | ||
build/ | ||
.env | ||
/autogenerated-structure-template/app/core/__init__.py | ||
/autogenerated-structure-template/app/core/config.py | ||
/autogenerated-structure-template/app/__init__.py | ||
/autogenerated-structure-template/app/database.py | ||
/autogenerated-structure-template/app/main.py | ||
/autogenerated-structure-template/tests/__init__.py | ||
/autogenerated-structure-template/.gitignore | ||
/autogenerated-structure-template/.pre-commit-config.yaml | ||
/autogenerated-structure-template/docker-compose.yaml | ||
/autogenerated-structure-template/Dockerfile | ||
/autogenerated-structure-template/gino-fastapi-layout.svg | ||
/autogenerated-structure-template/LICENSE | ||
/autogenerated-structure-template/README.md | ||
/autogenerated-structure-template/requirements.txt | ||
/autogenerated-structure-template/setup.cfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[tool.pytest.ini_options] | ||
addopts = '-sv' | ||
pythonpath = '.' | ||
|
||
[tool.ruff.lint] | ||
extend-select=['I'] | ||
|
||
[tool.ruff.format] | ||
quote-style='single' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
flake8 | ||
mypy | ||
ruff | ||
watchgod==0.8.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
fastapi==0.79.0 | ||
orjson==3.4.1 | ||
fastapi==0.93.0 | ||
pydantic==1.9.0 | ||
python-dotenv==1.0.1 | ||
uvicorn==0.18.2 | ||
uvloop==0.14.0; sys_platform != "win32" and implementation_name == "cpython" | ||
uvloop==0.17.0; sys_platform != "win32" and implementation_name == "cpython" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Run through console: | ||
uvicorn src.main:app --host 127.0.0.1 --port 8080 | ||
additional notes are in the `../README.md` file | ||
""" | ||
from pathlib import Path | ||
|
||
from pydantic import BaseSettings | ||
|
||
BASE_DIR = Path.cwd().parent.parent | ||
# print('BASE_DIR', BASE_DIR) | ||
|
||
|
||
class AppSettings(BaseSettings): | ||
# Don't use this name, set any name in '.env' file. | ||
PROJECT_NAME: str = "Default app's name" | ||
|
||
class Config: | ||
env_file = '.env' | ||
|
||
|
||
app_settings = AppSettings() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Routs which work "from the box": | ||
docs_url: "/docs" - Swagger | ||
redoc_url: "/redoc" - ReDoc | ||
openapi_url: "/openapi.json" - OpenAPI documentation | ||
""" | ||
from fastapi import FastAPI | ||
|
||
from src.core import config | ||
|
||
|
||
def get_application(): | ||
_app = FastAPI( | ||
title=config.app_settings.PROJECT_NAME, | ||
) | ||
|
||
return _app | ||
|
||
|
||
app = get_application() |