GitHub - ziwon/falcon-rest-api: Falcon REST API with PostgreSQL using ORM
Falcon + Python + HerokuのAPIのサンプル?
READMEみたいにインストールをし、
環境変数のセット(dev, live, localがある)
export APP_ENV=live
※liveはこのサンプルの実際のawsの環境?
./bin/run.sh start
をすると
from cerberus import Validator, ValidationError ImportError: cannot import name 'ValidationError'
のエラー。
Welcome to Cerberus — Cerberus is a lightweight and extensible data validation library for Python
なぜかrequirements.txtでインストールしたのに入ってなかったので、手動で入れたため?
pip install cerberus falcon-rest-api/git/master ! Collecting cerberus Using cached Cerberus-1.0.1.tar.gz Installing collected packages: cerberus Running setup.py install for cerberus ... done Successfully installed cerberus-1.0.1
こうした。
- from cerberus import Validator, ValidationError + from cerberus import Validator + from cerberus.errors import ValidationError
localで動かす
PostgreSQL起動
postgres -D /usr/local/var/postgres
dedaultテーブル作る
createdb default
環境変数の設定
export APP_ENV=live
起動
./bin/run.sh start