Sanic を用いて RESTful API を実装したい.
dockerfiles/
├- db/
│ ├- docker-compose.yml
└- test_db/
└- docker-compose.yml
SanicApiPra/
├- tests/
│ ├- __inint__.py
│ └- test_api.py
│
├- __inint__.py
└- main.py
README.md
requirements.txt
$ pip install -r requirements.txt
$ cd docker/db/
$ docker-compose up -d
$ cd SanicApiPra/
$ python3 main.py
# localhost:8000/
最初に Database を作成し、ソースコードに追加(編集)する必要があります。
# 仮想環境の作成
$ poetry new api_sanic
# 仮想環境の有効化
$ poetry shell
#
$ poetry add (パッケージ名)
# pyproject.tomlに記載のパケージをインストール
$ poetry install