Entries from 2018-08-16 to 1 day

【snake】 Section: 15 Quality of Life CLI Improvements

Creating Secure Tokens 以下のコマンドでsecret keyを生成することができる。 短いキーを作ることもできる。 $ docker-compose exec website snakeeyes secret $ docker-compose exec website snakeeyes secret 64 cliフォルダー/コマンドフォルダー/cmd_se…

【snake】Section: 14 Logging, Middleware and Error Handling

Tracking Response Times for All Requests(gunicorn.pyに関して) 以下を実行すると docker-compose up --build 1000で割れば秒表示になるのでマイクロセコンドで表示する。 今回の場合だと2.844秒かかったとわかる。 configフォルダーのgunicorn.pyで確認…

【snake】Section: 13 Creating a Custom Admin Dashboard

Why Are We Not Using Flask-Admin? ①カスタマイズに関してより知識を深めるため。 ②デバッグでテストする際に何千行も書かれた3rd partyを使うべきでない。 ③大して難しくない。 Adding the Admin Blueprint Viewing the Main Dashboard Section12からAdmin…

【snake】Section: 12 Creating a Complete User System

requirements.txt に関して psycopg2はpostgresqlのデータベースと接続する。 Flask-SQLAlchemはextentionを簡素化する。 Flask-Loginはログイン機能のextentionである。 Configuring the App to Handle Users SQLAlchemyを使うには接続するための情報を設定…