本文整理汇总了Python中views.app.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: run
def run(config):
from views import app
app.config['computer_id'] = config.computer_id
app.config['DATABASE_URI'] = config.database_uri
app.run(host=config.host, port=int(config.port), debug=True)
开发者ID:shadowchmod,项目名称:slapos.core,代码行数:5,代码来源:__init__.py
示例2: int
# project/run.py
import os
from views import app
port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port, debug=False)
开发者ID:vdomike,项目名称:flask-calc,代码行数:7,代码来源:run.py
示例3:
from gevent import monkey
monkey.patch_all()
from views import app
app.run(host='127.0.0.1', port=5000, debug=True)
开发者ID:davidthewatson,项目名称:flasgist,代码行数:5,代码来源:run_server.py
示例4:
from views import app
app.run(debug=True, port=int('5001'))
开发者ID:nubianMONK,项目名称:bookmarks_repository_client_api,代码行数:2,代码来源:run.py
示例5:
"""
This script runs the CarProject application using a development server.
"""
from views import app
DEBUG = False
HOST = '0.0.0.0'
SERVER_PORT = 8000
THREADED = True
if __name__ == '__main__':
app.run(HOST, port=SERVER_PORT, debug=DEBUG, threaded=THREADED)
开发者ID:shalvin,项目名称:carproject,代码行数:14,代码来源:runserver.py
示例6:
from views import app
app.run(debug=True,host="0.0.0.0",port=88)
开发者ID:ilaer,项目名称:books_list,代码行数:2,代码来源:app.py
示例7: int
"""Mog run file."""
import os
from views import app
port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port, debug=True)
开发者ID:powerlanguage,项目名称:mog,代码行数:6,代码来源:run.py
示例8:
from views import app
if __name__ == "__main__":
app.run(debug=True, threaded=True, host='0.0.0.0')
开发者ID:vijaykrishnavanshi,项目名称:Projects,代码行数:4,代码来源:wsgi.py
示例9: int
from views import app
import os
PORT = int(os.getenv('PORT', 8080))
app.run(debug=True, port=PORT)
开发者ID:maxwang051,项目名称:eisenpower,代码行数:5,代码来源:server.py
示例10: RotatingFileHandler
# The above is needed to set the correct encoding, see https://www.python.org/dev/peps/pep-0263/
try:
from views import app
import logging
from logging.handlers import RotatingFileHandler
except Exception as e:
print '####', e
raise
# Logging stuff
file_handler = RotatingFileHandler('log/log.log', 'a', 1 * 1024 * 1024, 10)
file_handler.setFormatter(logging.Formatter('''#### %(asctime)s ==> %(levelname)s: %(message)s [in %(filename)s:%(lineno)d]'''))
# Change logging.INFO to logging.DEBUG to see debugging verbose information
file_handler.setLevel(logging.INFO)
app.logger.setLevel(logging.INFO)
app.logger.addHandler(file_handler)
app.logger.info('Starting up...')
if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0")
# Only matter of style...
file_handler.setFormatter(logging.Formatter('''#### %(asctime)s ==> %(levelname)s: %(message)s [in %(filename)s:%(lineno)d]
################'''))
app.logger.info('Switching off..')
开发者ID:ZanSara,项目名称:caisovico,代码行数:30,代码来源:run.py
示例11: int
import os
from views import app
port = int(os.environ.get('PORT', 5000))
app.run(debug=False, host='0.0.0.0', port=port)
开发者ID:Kriordan,项目名称:lollywedding,代码行数:5,代码来源:run.py
示例12:
# coding:utf-8
from views import app
if __name__ == '__main__':
app.run(debug=True,port=9090)
开发者ID:51reboot,项目名称:actual_07_homework,代码行数:6,代码来源:runserver.py
示例13: Markdown
import os
from flaskext.markdown import Markdown
from views import app
Markdown(app)
if __name__ == '__main__':
app.run(host="0.0.0.0")
开发者ID:markberger,项目名称:markjberger.com,代码行数:8,代码来源:app.py
示例14:
#encoding: utf-8
from views import app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=9004, debug=True)
开发者ID:51reboot,项目名称:actual_07_homework,代码行数:6,代码来源:runserver.py
示例15:
#encoding: utf-8
from views import app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8888, debug=True)
开发者ID:51reboot,项目名称:actual_07_homework,代码行数:6,代码来源:runserver.py
示例16: int
import os
from views import app
app.debug = app.config['DEBUG']
if app.debug:
app.run()
else:
port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port)
开发者ID:v-y-l,项目名称:Challenges,代码行数:9,代码来源:run.py
示例17: ghz
def ghz():
app.run(fl, port = 4448, host = '0.0.0.0')
开发者ID:sona1111,项目名称:flaskchat,代码行数:2,代码来源:__init__.py
示例18: clear_database
#!/usr/bin/env python
#
# application.py -- A web server presenting a catalog of items
# Author: Rudy Reeves
from db import clear_database, create_category
from views import app
if __name__ == '__main__':
clear_database()
test_category_1 = create_category("Food")
test_category_2 = create_category("Cars")
app.secret_key = "lRYRXEimZGfbt3Q2TpD_6_Kj"
app.debug = True
app.run(host='0.0.0.0', port=8000)
开发者ID:RudyReeves,项目名称:fullstack,代码行数:18,代码来源:application.py
示例19: main
def main():
ssl(app)
db.init_app(app)
app.run(ssl_context = ctx, host='0.0.0.0', port=8082)
开发者ID:mayabrandi,项目名称:NIPT,代码行数:4,代码来源:run_app.py
示例20:
#!/Users/cjj/remoteServer/flask/bin/python
#-*-coding:utf-8-*-
from views import app
app.run(host="0.0.0.0", debug = True)
开发者ID:importcjj,项目名称:NotTubed,代码行数:6,代码来源:run.py
注:本文中的views.app.run函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论