フラスコ - モンゴレスト

MongoDB / MongoEngineのフラスコのRestful APIフレームワーク
今すぐダウンロード

フラスコ - モンゴレスト ランキングとまとめ

広告

  • Rating:
  • ライセンス:
  • BSD License
  • 価格:
  • FREE
  • 出版社名:
  • Anthony Nemitz
  • 出版社のWebサイト:
  • http://github.com/elasticsales/

フラスコ - モンゴレスト タグ


フラスコ - モンゴレスト 説明

Flask-MongorestはMongoDB / MongoEngine.SetupFrom FlaskFrom FlaskからFlask.ext.ext.Mongorest..ext.mongorest.Mongorest.Mongorest.Mongorest.Mongorest.Mongorest.mongorest.mongorest.Mongorest.ResourceFromFromStromeStromorest.export.ResourceFromFrougk.ext.Mongorest.extromorest.ext.Mongorest.ResourceSfrousfフラスコから.ext.mongors.ext.ext.Mongorestメソッドをインポートするアプリ= flask(__ name __)app.config.update(mongodb_host = 'localhost'、mongodb_host = '27017'、mongodb_db = 'mongorest_example_app'、)db = mongoEngine( App)API = Mongorest(App)クラスユーザー(DB.Document):email = db.emailfield(一意= true、必須= true)クラスコンテンツ(db.embeddedDocument):text = db.StringField()クラスContentResource(リソース) :document = contentclass post(db.document):title = db.stringfield(max_length = 120、必須= true)author = db.referencefield(ユーザー)content = db.embeddeddedDocumentField(コンテンツ)クラスPostresource(リソース):Document = POST related_resources = {'content':contentResource、} filters = {'title':、 'author_id':、} rename_fields = {'author': 'author_id'、} @ api.register(name = 'posts'、url = '/ posts /'・Class PostView(ResourceView):Resource = Postresourceメソッド= 次のCURLコマンドを使用することができます:POST:curl -h "コンテンツを作成するtype:application / json "x post -d '{" title ":" first post! "、" author_id ":" author_id_from_previous_api_call "、" content ":{" text ":"これは私たちのテストポストコンテンツです "} '' '' http:/0.0.0.0:5000/posts/ {"1"、 "title": "最初の投稿!"、 "author_id": "author_id_from_a_previous_api_call"、 "content":{"text": 「これは私たちのテストポストコンテンツです。 msgstr "" author_id_from_a_previous_api_call "、" content ":{" text ":"これは私たちのテストポストコンテンツです "}}タイトル:curl http://0.0.0.0:5000/posts/またはcurl http ://0.0.0.0:5000 /投稿/?TITLE__STARTSWITH = FIR st post {"data"::authorization = request.headers 。len(承認) )== 2と承認 .lower()== 'basic':authorization_parts = base64.b64decode(承認)。パーティション( ':')key = smart_unicode(authorization_parts )API_Key = apikey.objects.get(key__exact = key)api_key.user:login_user:login_user(api_key.user)setAttr(current_user、 'api_key'、api_key)を除く(TypeError、UnicodeDecodeError、apikey.doesnotexist):asp Return FalseClass BaseresourceView(ResourceView) )authentication_methods = [SessionAuthentication、ApikeYauthe.テストの実行スイートPackageは、自動テストにNoSetestsを使用します。テストを実行するためにPython Setup.py Nosetestsを実行するだけです。セットアップやその他の準備は必要ありません.ContributingPull要求が大幅に感謝されています。製品のホームページ


フラスコ - モンゴレスト 関連ソフトウェア

SendTX

コマンドラインからBitcoin Networkへの直列化されたBitcoinトランザクションを送信する ...

105

ダウンロード