def run_test_server(): """Used by the phantomjs tests to run a live testing server""" # running the server in debug mode during testing fails for some reason app.config['DEBUG'] = False app.config['TESTING'] = True port = app.config['TESTSERVER_PORT'] # Don't use the production database but a temporary test database. app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///test.db" db.drop_all() db.create_all() db.session.commit() # Add a route that allows the test code to shutdown the server, this allows # us to quit the server without killing the process thus enabling coverage # to work. app.add_url_rule('/shutdown', 'shutdown', shutdown, methods=['POST', 'GET']) main.use_log_file_handler() app.run(port=port, use_reloader=False, threaded=True) db.session.remove() db.drop_all()
from app.main import app app.run(host="0.0.0.0", port=5000)
from app.main import app if __name__ == "__main__": # app.run(debug=True) app.run(host='0.0.0.0', debug=True, port=3030)
#!/usr/bin/env python # -*- coding: utf-8 -*- # from app import app # # app.run(debug=True) from app.main import app # app = create_app() app.run(debug=False, host="127.0.0.1", port=5000) # app.run(debug=False)
from app.main import app if __name__ == "__main__": app.run( # Starts the site host= '0.0.0.0', # EStablishes the host, required for repl to detect the site port=5000, # Randomly select the port the machine hosts on. threaded=False)
#!/usr/bin/env python # -*- coding: utf-8 -*- """ run_c9.py - запуск проекта в среде c9io ситемные переменные: IP - ip("0.0.0.0") PORT - port("8080") при запуске реальный хост - http://python-apps-diver.c9users.io/ или http://python-apps-diver.c9users.io:8080 """ import os from app.main import app # use os.getenv(PORT, 8080) as the port and os.getenv(IP, 0.0.0.0) as the host in your scripts! host = os.getenv("IP", "0.0.0.0") port = int(os.getenv("PORT", 8080)) # app = create_app() help_host_text = "http://python-apps-diver.c9users.io/" print("starting app on: {}:{}".format(host, port)) print("starting app on: {}".format(help_host_text)) app.run(debug=True, host=host, port=port) # app.run(debug=False)
from app.main import app app.run(host='0.0.0.0', debug=False) # host='0.0.0.0', port=8080,
from app.main import app import os import errno if __name__ == "__main__": UPLOAD_FOLDER = './app/static' DATA_URL = './app/static/data.csv' app.secret_key = "secret key" app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER app.config["DATA_URL"] = DATA_URL try: os.makedirs(UPLOAD_FOLDER) except OSError as e: if e.errno != errno.EEXIST: raise app.config['MAX_CONTENT_LENGTH'] = 100 * 1024 * 1024 * 1024 app.run(host='0.0.0.0', port=5001, debug=True, threaded=True)
#!/opt/python27/bin python from app.main import app from werkzeug.contrib.fixers import ProxyFix app.wsgi_app = ProxyFix(app.wsgi_app) if __name__ == '__main__': app.run("0.0.0.0")
if __name__ == "__main__": from app.main import app app.run()
import sys sys.path.append('/var/www/apigithubalfa') from app.main import app as application application.run(debug=True)
#! /usr/bin/env python from app.main import app as prog prog.run(debug=True,host='0.0.0.0',port=8080)
@authors: Andrei Sura <*****@*****.**> Ruchi Vivek Desai <*****@*****.**> Sanath Pasumarthy <*****@*****.**> Nicholas Rejack <*****@*****.**> """ import argparse from app.main import app, mail from app import initializer from config import MODE_DEBUG # Configures routes, models app = initializer.do_init(app, mode=MODE_DEBUG) mail.init_app(app) if __name__ == "__main__": """ Entry point for command line execution """ parser = argparse.ArgumentParser() parser.add_argument('--port', dest='port', type=int, default=5000, help="Application port number") args = parser.parse_args() ssl_context = initializer.get_ssl_context(app) print("curl -skL https://localhost:{}".format(args.port)) app.run(host='0.0.0.0', port=args.port, ssl_context=ssl_context)
from app.main import app if __name__ == "__main__": app.run(port=8000, debug=True)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # from app import app # # app.run(debug=True) from app.main import app # app = create_app() app.run(debug=True, host="127.0.0.1", port=5000) # app.run(debug=False)
# -*- coding: utf-8 -*- from app.main import app import webbrowser if __name__ == "__main__": app.run("localhost", port=5000, debug=True) # 테스트할때는 이것으로 쓰세요 #app.run() #ngrok 쓸 때는 이거로 쓰세요 webbrowser.open("http://localhost:5000", 2)
def run(): app.secret_key = SECRET_KEY app.run()
from app.main import app if __name__ == "__main__": app.run(host='0.0.0.0', port=5000, debug=True) # debug = True
def run_coreserver(): core_app.run(debug=True, port=5000)
from app.main import app import firebase_admin from firebase_admin import credentials import os import json # Initialize Firebase Admin App cred = credentials.Certificate({**json.loads(os.environ['FIREBASE_CRED'])}) firebase_admin.initialize_app(cred, { 'storageBucket': 'web-eye-tracker-front.appspot.com' }) if __name__ == "__main__": app.run(debug=os.environ['FLASK_ENV'])
from app.main import app if __name__ == '__main__': print("Starting python app") app.run(host='0.0.0.0',port=8080,processes=2,threaded=False)
from app.main import app if __name__ == "__main__": app.run(host="127.0.0.1", port=5000, debug=True)
from app.main import app from app import db if __name__ == "__main__": with app.app_context(): db.create_all() app.run(debug=True)
from app.main import app if __name__ == "__main__": app.run(host='0.0.0.0')
Goal: Implement the application entry point @authors: Andrei Sura <*****@*****.**> Ruchi Vivek Desai <*****@*****.**> Sanath Pasumarthy <*****@*****.**> Nicholas Rejack <*****@*****.**> """ import argparse from app.main import app, mail from app import initializer from config import MODE_DEBUG # Configures routes, models app = initializer.do_init(app, mode=MODE_DEBUG) mail.init_app(app) if __name__ == "__main__": """ Entry point for command line execution """ parser = argparse.ArgumentParser() parser.add_argument('--port', dest='port', type=int, default=5000, help="Application port number") args = parser.parse_args() ssl_context = initializer.get_ssl_context(app) print("curl -skL https://localhost:{}".format(args.port)) app.run(host='0.0.0.0', port=args.port, ssl_context=ssl_context)
from app.main import app if __name__ == "__main__": app.run(threaded=True)
__author__ = 'vcaen' from app.main import app if __name__ == '__main__': app.run(host="0.0.0.0", debug=True)
from app.main import app if __name__ == '__main__': app.run(port=5000)
import os from app.main import app if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host="0.0.0.0", port=port)
from app.main import app if __name__ == "__main__": # app.run() app.run(host="0.0.0.0", port=80)
def run(): """Main entry """ app.run(host='0.0.0.0')
from app.main import app if __name__ == '__main__': app.run(host='127.0.0.1', port=5500, debug=True)
import os import sys from app import conf from app.main import app sys.path.append(os.path.dirname(__file__)) if __name__ == '__main__': print('Running server on http://%s:%d' % (conf.HOST, conf.PORT)) app.run(debug=conf.DEBUG, host=conf.HOST, port=conf.PORT)
#!/usr/bin/env python from app.main import app if __name__ == '__main__': app.run(debug=True, host="127.0.0.1") #app.run(debug=True, host="ignalion.me")
from app.main import app app.debug =True app.run('0.0.0.0', 8000)
# Runs flask api from app.main import app if __name__ == "__main__": # app.run() app.run(host='localhost', port=9874)
from app.main import app app.run(host='0.0.0.0', port=7273)
from app.main import app app.run(host='0.0.0.0', port=8080, debug=True)
from app.main import app if __name__ == '__main__': app.run(debug=True)
# encoding=utf8 from app.main import app import logging from logging.handlers import WatchedFileHandler import gevent.monkey if __name__ == "__main__": gevent.monkey.patch_all() acclog = logging.getLogger('gunicorn.access') acclog.addHandler(WatchedFileHandler('/logs/pyservice_log/pyservice_access.log')) acclog.propagate = False errlog = logging.getLogger('gunicorn.error') errlog.addHandler(WatchedFileHandler('/logs/pyservice_log/pyservice_error.log')) errlog.propagate = False app.run()
from app.main import app import os if __name__ == '__main__': app.run(host=os.getenv('IP','0.0.0.0'),port=int(os.getenv('PORT',5656)))