This tutorial takes a test-first approach to implementing token-based authentication in a Flask app using JSON Web Tokens (JWTs). Updates: 08/04/2017: Refactored route handler for the PyBites Challenge. Objectives By the end of this tutorial, you will be able to… Discuss the benefits of using JWTs versus sessions and cookies for authentication Implement user authentication with JWTs Blacklist user
Multiple Apps The application context (and its purpose) is indeed confusing until you realize that Flask can have multiple apps. Imagine the situation where you want to have a single WSGI Python interpreter run multiple Flask application. We're not talking Blueprints here, we're talking entirely different Flask applications. You might set this up similar to the Flask documentation section on "Appl
Introduction In this blog post, I’ll be explaining what NGINX is and how to configure it for serving a Flask web application. This blog post is part of a larger series on deploying Flask applications. I’ve found a lot of documentation about NGINX and how to configure it, but I wanted to dive into the details for how NGINX can be used in a Flask web application and how to configure it. I’ve found t
It seems that one of the biggest questions around Flask-SQLAlchemy is how to use SQLAlchemy models outside of a Flask application. Several questions have been posted on sites like Stackoverflow and Reddit. There is an open issue on Github asking to document how to use your own declarative base class. As of this writing, there are even several pull requests to make Flask-SQLAlchemy easier to work w
クラウド破産しないためのサービス選び 同じゲームを作った仲間がクラウド破産しそうになりました。個人で破産したくなかったのでこの時点で従量課金制であるAWSとGoogleCloudは除外。さくらかConoHaかなと思っていたのですが、ConoHaがSSDプランを格安で始めていたのでConoHaを選択しました。昨年お仕事で使ってたAWS-RDSのHDDをSSDに切り替えたらCPU使用率とスループットが大幅に改善したのでSSD万能説を信奉することにしました。 サーバ構成をどう設計するか オールインワンかDB+APPサーバ構成にするか。サーバを分割した場合DBとAPP間の通信レイテンシが気になります。サーバが異なっていてもconnection poolingをちゃんと設定していれば1-5msで応答が返ってきます。オールインワンで構築すると将来DBサーバとAPPサーバを分割するときDB移管作業がとっ
概要 まずは先に二つの記事をどうぞ DynamoDB HTTP API が独特な仕様なので紹介 Python の JSON Schema ライブラリを使ってみる さて、 最近は JSON を受け取って JSON を返す、この仕組みを実装する事が多いのですが、HTTP ベースとなると色々辛くなってきます。URL の設計、メソッドの選択などなど。もう面倒くさいから URL や メソッドは統一してしまいます。 機能判定は HTTP の独自定義したヘッダーを使う X-Amz-Target: DynamoDB_20120810.PutItem X-<会社名?>-Target: サービス名_日付.機能名 URL は / のみ メソッドは POST のみ 全てのやりとりは JSON で バリデーションは Req/Res 両方を JSON スキーマを使う とにかく頑張らない仕組みを作ります。 ライブラリの
ここ数ヶ月 SQLAlchemy を使って開発をしている。 開発当初は特に問題もなく調子よく行っていたが、自分のローカル環境の MySQL の設定を本番に近づけたため、SQLAlchemy がエラーをはいた - Memo が出た。 pool_recycle の値を短くすれば解決と思ったが、解決しなかった。 前提として FW は Flask を利用。SQLAlchemy は素で scoped_session を使っている。 Flask-SQLAlchey や Flask-Alchemy-Session は使ってない。 autocommit, autoflush は False の設定。 でたエラーが sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く