def main() -> None: """ Validate CLI args and generate calendar, print menu otherwise """ try: run() except IncorrectFormatForYear: print("Year must be an integer > 1582") except Exception as e: print_options() raise e
from application import application as app if __name__ == "__main__": app.run()
from application import application if __name__ == '__main__': application.run(host='127.0.0.1', port=5000, threaded=True)
import os from application import application if __name__ == '__main__': port = int(os.environ.get('PORT', 5000)) application.run(host='0.0.0.0', port=port)
#!flask/bin/python ''' Reference https://medium.com/@rodkey/deploying-a-flask-application-on-aws-a72daba6bb80 ''' from flask import Flask from application import application if __name__ == '__main__': application.run(host='0.0.0.0')
from application import application if __name__ == '__main__': application.run(host='0.0.0.0', port=7000, debug=True)
from application import application if __name__=="__main__": application.run(host="0.0.0.0", port=8000, debug=True)
user = User(name=topup.customer_name, school=school, balance=topup.amount) db.session.add(user) db.session.commit() card = Card(number=topup.card_num, expiry_date=topup.card_expiry_date, owner_id=user.id) db.session.add(card) db.session.commit() else: school = School(name=topup.school_name) db.session.add(school) db.session.commit() user = User(name=topup.customer_name, school=school, balance=topup.amount) db.session.add(user) db.session.commit() card = Card(number=topup.card_num, expiry_date=topup.card_expiry_date, owner_id=user.id) db.session.add(card) db.session.commit() return jsonify(status=str(topups.__len__()) + " topups added", error=None) if __name__ == '__main__': application.run(host='charopy-local', port=5001, debug=True)
from application import application # launches the application on a local server if __name__ == "__main__": application.run('localhost', 8080)
from application import application if __name__ == "__main__": application.run(host=application.config["HOST"], port=application.config["PORT"])
for i in itertools.product(noderange, ['x', 'y', 'z']) ] header_dict = collections.OrderedDict() for k in headers: header_dict[k] = None def data_writer(header_dictionary, arrays): csvfile = io.StringIO() headerwriter = csv.DictWriter(csvfile, delimiter=',', fieldnames=header_dictionary) headerwriter.writeheader() yield csvfile.getvalue() for i in arrays: test_dixt = collections.OrderedDict( {k: i.get(k, None) for k in header_dictionary}) csvfile = io.StringIO() csvwriter = csv.DictWriter(csvfile, delimiter=',', fieldnames=header_dictionary) csvwriter.writerow(test_dixt) val = csvfile.getvalue() yield val return functools.partial(data_writer, header_dict, arrs) if __name__ == '__main__': application.run(port=5000)
from application import application if __name__ == "__main__": application.run(host='0.0.0.0', port=5000, threaded=True, debug=True)
from application import application as app if __name__ == "__main__": app.run(debug=True)
from application import application import os if __name__ == '__main__': port = int(os.environ.get('PORT', 5000)) application.run(debug=True, host='127.0.0.1', port=port)
from application import application application.run(debug=True)
from werkzeug.contrib.profiler import ProfilerMiddleware from application import application # This is your Flask app application.wsgi_app = ProfilerMiddleware(application.wsgi_app) application.run(debug=True) # Standard run call
from application import application from config import config_path application.config.from_object(config_path) if __name__ == "__main__": application.run( host='0.0.0.0', port=5000, debug=application.config['DEBUG'] )
from application import application if __name__ == '__main__': application.run(port=8000)
#!flask/bin/python import os from application import application as app app.cache.clear() app.run(debug=app.config.get('DEBUG', True), port=int(os.getenv('DEV_PORT', 5000)))
from flask import Flask from application import application if __name__ == "__main__": application.run(host='0.0.0.0', port=8080)
from application import application if __name__ == "__main__": # application.run() # Use for localhost # Use for aws application.run(host='0.0.0.0', port='80')
from application import application from routes import ( index, breed_shelters, page_not_found, activity_query, breed_query, dog_query, shelter_query, search_website, ) """ Runs application """ if __name__ == "__main__": application.run(host="0.0.0.0")
#!/usr/bin/env python from application import application # Elastic Beanstalk initialization # application.secret_key = 'cC1YCIWOj9GgWspgNEo2' if __name__ == '__main__': application.run(debug=True)
from application import application from flask import url_for __author__ = 'elhe' application.debug = True application.run(port=8080) url_for('static', filename='style.css')
from flask import Flask, render_template import json from application import application import sample import folders import login import register import registration from beaker.middleware import SessionMiddleware session_opts = { #'session.type': 'ext:memcached', 'session.type': 'cookie', 'session.validate_key': 'abc', 'session.url': '127.0.0.1:5001', 'session.data_dir': './cache', 'session.auto': True, 'session.save_accessed_time': True } @application.route('/') def root(): return render_template('sample.html') if __name__ == '__main__': application.wsgi_app = SessionMiddleware(application.wsgi_app,session_opts) application.run(debug=True, threaded=True, port=5001)
print('Database created') @manager.command def initdb(): db.create_all() print('Database initialized') @manager.command def deletedb(): #db.create_all() print('Database deleted') @manager.command def dropdb(): if prompt_bool('Are you sure you want to DELETE the database ?'): db.drop_all() print('Database is all gone !') if __name__ == "__main__": #manager.run() print("**************************") print('In application.py Name: ', __name__) print(' In application.py File: ', __file__) print("**************************") application.run(debug=False)
from application import application import os if __name__ == '__main__': port = int(os.environ.get('PORT', 5000)) application.run(debug=True,host='0.0.0.0',port=port)
from application import application from models import * from views import * if __name__ == "__main__": application.run(host="127.0.0.1")
from application import application if __name__ == '__main__': application.run(host='0.0.0.0', port=4000)
# -*- coding: utf-8 -*- """ Created on Thu May 07 23:04:36 2015 @author: ctchu """ #from flask import Flask #app = Flask(__name__) # #@app.route('/') #def hello_world(): # return 'Randy!!! Hello World!' from flask import Flask application = Flask(__name__) from application import application if __name__ == '__main__': application.run(debug = True) # set debug to True, so whenever the source code changes, Flask will restart the service automatically
from application import application if __name__ == '__main__': application.run(debug=True, host='0.0.0.0')
#!flask/bin/python import os from application import application as app app.run(debug=app.config.get('DEBUG', True), port=int(os.getenv('DEV_PORT', 5000)))
from application import application if __name__ == "__main__": application.run()
from application import application as app import settings import request import database if __name__ == "__main__": database.init_db() app.run()
import os import sys sys.path.append(os.path.join(os.path.abspath('.'), 'lib')) from application import application if __name__ == '__main__': application.run()
from selenium import webdriver from selenium.webdriver.common.keys import Keys from time import sleep from threading import Thread from application import application import main Thread(target=lambda: application.run(port=5001), daemon=True).start() def test_sample(): driver = webdriver.Firefox() driver.get("http://localhost:5001") elem = driver.find_element_by_id('sample') assert elem.text == 'loading' sleep(3) assert elem.text == 'done' driver.close()