carga_gtfs/debug.py

27 lines
611 B
Python
Raw Normal View History

2023-03-01 14:18:49 -03:00
import sys
from webinterface import create_app, Config
config = Config()
config.SQLALCHEMY_DATABASE_URI = 'sqlite:///GC.db'
config.DEBUG = True
if __name__ == "__main__":
iapp = create_app(config)
if len(sys.argv) == 3:
host = sys.argv[1]
port = sys.argv[2]
elif len(sys.argv) == 2:
import random
host = sys.argv[1]
port = random.randrange(3000,9000,1)
else:
import random
host = '127.0.0.1'
port = random.randrange(3000,9000,1)
iapp.run(host=host, port=port)