示例#1
0
"""Usage: run.py [--host=<host>] [--port=<port>] [--debug | --no-debug]

--host=<host>   set the host address or leave it to 0.0.0.0.
--port=<port>   set the port number or leave it to 5500.

"""
from weather import app
if __name__ == '__main__':
    from docopt import docopt
    arguments = docopt(__doc__, version='0.1dev')

    host = arguments['--host']
    port = arguments['--port']
    debug = not arguments['--no-debug']

    if not port: port = 5500
    if not host: host = '0.0.0.0'

    app.run(debug=debug, host=host, port=int(port))
示例#2
0
from weather import app

if __name__ == "__main__":
    app.run()
示例#3
0
from weather import app
import os
from os import path

extra_dirs = ['./weather/templates', './weather/static']
extra_files = extra_dirs[:]
for extra_dir in extra_dirs:
    for dirname, dirs, files in os.walk(extra_dir):
        for filename in files:
            filename = path.join(dirname, filename)
            if path.isfile(filename):
                extra_files.append(filename)

if __name__ == '__main__':
    app.run(debug=True, extra_files=extra_files)
示例#4
0
import os
from weather import app

if __name__ == "__main__":
    # app.run(debug=True)
    # Bind to PORT if defined, otherwise default to 5000.
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port)
示例#5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Runserver
---------
This module is used to run the application with Flasks built in WSGI server.
Should NOT be used in production.

"""

from weather import app

if __name__ == "__main__":
    app.run(debug=True, use_reloader=True)
示例#6
0
from weather import app
app.run(host="0.0.0.0",port="8080")
示例#7
0
from weather import app, views

if __name__ == "__main__":
    app.run(debug=True)
示例#8
0
文件: app.py 项目: PeterKetel/weather
from weather import app

if __name__ == '__main__':
    app.run(debug=True, port=5001)  #run app in debug mode on port 5001