本文整理匯總了Python中flask.app.Flask.config['DEBUG']方法的典型用法代碼示例。如果您正苦於以下問題:Python Flask.config['DEBUG']方法的具體用法?Python Flask.config['DEBUG']怎麽用?Python Flask.config['DEBUG']使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類flask.app.Flask
的用法示例。
在下文中一共展示了Flask.config['DEBUG']方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Flask
# 需要導入模塊: from flask.app import Flask [as 別名]
# 或者: from flask.app.Flask import config['DEBUG'] [as 別名]
from socketio.mixins import BroadcastMixin
from werkzeug.exceptions import BadRequest
from gevent import monkey
monkey.patch_all()
from socketio.namespace import BaseNamespace
from socketio.server import SocketIOServer
from werkzeug.wsgi import SharedDataMiddleware
from werkzeug.serving import run_with_reloader
from flask.app import Flask
from TwitterAPI import TwitterAPI
app = Flask(__name__)
app.config['DEBUG'] = True
TwitterApi = TwitterAPI(
'RfJOrhv4ElNAGb4dQnJZ3A',
'dwEu677epT6xzwWrVu2UwVwNH9FPr6LwDUOippVb4',
'39249210-Fl4xReKp6Uh0cIUV4rHS3FCh9J8uj9y9DVHwRQSHP',
'v0XwZ2ma1xdpA35as6a02YR9ihONT55BtjWMLc0Npsr6o'
)
def send_tweets(socket, hashtag_value):
tweets = TwitterApi.request('statuses/filter', {'track': hashtag_value})
for tweet in tweets.get_iterator():
socket.emit('tweet', tweet)
gevent.sleep()