文件名称:flask-pymongo:PyMongo对Flask应用程序的支持
文件大小:37KB
文件格式:ZIP
更新时间:2024-05-28 01:49:45
Python
Flask-PyMongo PyMongo对Flask应用程序的支持 快速开始 from flask import Flask , render_template from flask_pymongo import PyMongo app = Flask ( __name__ ) app . config [ "MONGO_URI" ] = "mongodb://localhost:27017/myDatabase" mongo = PyMongo ( app ) @ app . route ( '/' ) def home_page (): online_users = mongo . db . users . find ({ 'online' : True }) return render_template ( 'index.html' , online_users
【文件预览】:
flask-pymongo-master
----MANIFEST.in(212B)
----examples()
--------wiki()
----CONTRIBUTING.md(2KB)
----tox.ini(1KB)
----LICENSE(1KB)
----flask_pymongo()
--------helpers.py(6KB)
--------wrappers.py(4KB)
--------__init__.py(8KB)
--------tests()
----setup.py(2KB)
----README.md(645B)
----azure-pipelines.yml(684B)
----docs()
--------_themes()
--------conf.py(8KB)
--------requirements.txt(28B)
--------index.rst(14KB)
--------Makefile(5KB)
----.gitignore(143B)