Example #1
0
def run():
    while True:
        try:
            from app.views import app
        except Exception:
            traceback.print_exc()
            print()
            time.sleep(3)
        else:
            app.run(host="0.0.0.0", debug=True)
            break
Example #2
0
from flask import Flask
from app.config import default

__author__ = 'Darryl'

app = Flask(__name__)
app.config.from_object(default)

from app.views import app

if __name__ == '__main__':
    app.run(debug=True)
Example #3
0
#!/usr/bin/env python

from app.views import app


if __name__ == '__main__':
    app.run(port=app.config['PORT'],
    host=app.config['HOST'],
    debug=app.config['DEBUG'])
Example #4
0
import os
from app.views import app

if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))
    app.run('', port=port)
Example #5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'PatchLion'

from app.views import app

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=80, debug=True)
Example #6
0
from app.views import app
from app.settings import *

app.run(host='0.0.0.0', port=port, ssl_context='adhoc', debug=debug)
Example #7
0
from app.views import app

if __name__ == '__main__':
    app.run(host='0.0.0.0')
Example #8
0
from app.views import app
from app.settings import APP_PORT
if __name__ == "__main__":
    app.run(debug=True, host='127.0.0.1', port=APP_PORT)
Example #9
0
from app.views import app, scheduler
from app.lib.log_handle import Log

if __name__ == '__main__':
    scheduler.init_app(app)
    scheduler._logger = Log()
    scheduler.start()
    app.run(use_reloader=False, threaded=True, port=8000, host='0.0.0.0', debug=True)
Example #10
0
#!/usr/bin/env python
from app.views import app

if __name__ == "__main__":
    app.run(port=8080)
Example #11
0
from app.views import app

if __name__ == '__main__':
    app.run(host='127.0.0.1', port='8080', debug=True)
Example #12
0
#! C:\Program Files (x86)\Python\Python37\python.exe
# -*- coding:utf-8 -*-
from app.views import app

if __name__ == '__main__':
    app.run(host="localhost", port=8080)
Example #13
0
#! /usr/bin/env python
from app.views import app

if __name__ == "__main__":
    print("hello from views")
    app.run(debug=True, host="localhost", port=5000)
Example #14
0
# -*- coding: utf-8 -*-
from app.views import app

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000, debug=True)
Example #15
0
from app.views import app

if __name__ == '__main__':
    app.run(host='127.0.0.1', port=8000, debug=False)
Example #16
0
from app.views import app
import os
import sys
from dotenv import load_dotenv

available_commands = ("runserver", )

if __name__ == "__main__":
    if len(sys.argv) != 2 or sys.argv[1] not in available_commands:
        print(
            "\nWrong command, please use a rightful command following this",
            " typo:\tpython manage.py <COMMAND>\n\nList of available",
            "commands :\n" + "\n".join(available_commands),
        )
    else:
        load_dotenv()
        # Launch app
        debug = os.environ.get("FLASK_ENV", "production") == "development"
        port = int(os.environ.get("PORT", 5000))
        app.secret_key = os.urandom(12)
        app.run(host='0.0.0.0', port=port, debug=debug)
Example #17
0
def run():
    app.run(debug=True, host='0.0.0.0', port=9090, threaded=False)
Example #18
0
from app.models import db
from app.views import app

if __name__ == '__main__':
    db.create_all()
    app.run(debug=True)#项目启动,默认5000端口,可以自己修改
Example #19
0
# coding=utf-8
from app.views import app
from flask import g
try:
    import local_setings
except ImportError:
    local_setings = object

HOST = getattr(local_setings, 'HOST', '0.0.0.0')
PORT = getattr(local_setings, 'PORT', 8000)
DEBUG = getattr(local_setings, 'DEBUG', True)


@app.teardown_appcontext
def close_connection(exception):
    db = getattr(g, 'sqlite_db', None)
    if db is not None:
        db.close()
if __name__ == '__main__':
    app.run(host=HOST, debug=DEBUG, port=PORT)
Example #20
0
from app.views import app

app.run(debug=True, host='0.0.0.0')
Example #21
0
from app.views import app


if __name__ == '__main__':
    app.run(host='127.0.0.1', port=8000, debug=False)
Example #22
0
from app.views import app

if __name__ == "__main__":
    app.run(host='localhost', threaded=True, debug=True)
Example #23
0
def start():
    app.run(host='0.0.0.0', port=8088, debug=False)
Example #24
0
#!/usr/bin/python

from app import views
from app.views import app

if __name__ == "__main__":
    app.run(host="0.0.0.0",port=5000) 
Example #25
0
import os
from app.views import app

if __name__ == '__main__':
    app.run()
Example #26
0
import sys
from app.views import app


if __name__ == '__main__':
    # you can ignore the following and just have one line
    # app.run(debug=True, port=5050)
    app.debug = True
    if len(sys.argv) > 1 and int(sys.argv[1]) >= 5000:
    	port = int(sys.argv[1])
    	app.run(port=port)
    app.run(port=5000)

Example #27
0
import sys
from app.views import app

if __name__ == '__main__':
    # you can ignore the following and just have one line
    # app.run(debug=True, port=5050)
    app.debug = True
    if len(sys.argv) > 1 and int(sys.argv[1]) >= 5000:
        port = int(sys.argv[1])
        app.run(port=port)
    app.run(port=5000)
Example #28
0
#!/usr/bin/python3
"""
    OpenAPI spec version: 1.0.0
    Contact: [email protected]
    Generated by: https://github.com/vbondyrev/RentModel-RestAPI
"""

from app.views import app

if __name__ == '__main__':
    app.run('0.0.0.0')
Example #29
0
from app.views import app

if __name__ == '__main__':
    app.run(debug=True)
Example #30
0
#!env/bin/python
from app.views import app
app.run(debug=True,host='0.0.0.0')
Example #31
0
"""This script is responsible for starting a Flask application."""

import os
from app.views import app


if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port)
Example #32
0
import os
from app.views import app

app.debug = True

if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))
    app.run(host='127.0.0.1', port=port, debug=True)