#!/usr/bin/env python # # Author: Ying Xiong. # Created: May 26, 2015. from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import catalog from catalog import app if __name__ == "__main__": app.run(host="0.0.0.0", port=8000)
# This file is the main file that needs to be # run with the command python. This will run the # main file as well as start the server for the # given configuration from catalog import app from catalog import main if __name__ == '__main__': app.config['SESSION_TYPE'] = 'filesystem' app.debug = True app.run(host='0.0.0.0', port=8085)
from catalog import app from database import init_db from OpenSSL import SSL import os context = SSL.Context(SSL.SSLv23_METHOD) context.use_privatekey_file(os.path.join(os.path.dirname(__file__), 'ssl.key')) context.use_certificate_file( os.path.join(os.path.dirname(__file__), 'ssl.cert')) # init the database init_db() # configure ssl, required for oauth app.run(host='0.0.0.0', debug=True, ssl_context=context)
def runserver(): from catalog import app, create create(CONFIG) app.debug = True app.run(host='0.0.0.0', port=8000)
from catalog import app if __name__ == "__main__": app.run()
from catalog import app app.run(debug= True, host= '0.0.0.0', port = 8090)
#!/usr/bin/python from catalog import app if __name__ == "__main__": app.run(host='0.0.0.0')
__author__ = "Jeremy Nelson, Mike Stabile, Jay Peterson" from catalog import app from catalog.views import * if __name__ == '__main__': app.run(host='0.0.0.0', port=6726, debug=True)
def main(args): debug = args.debug or True app.run(host='0.0.0.0', port=8000, debug=debug)
from catalog import app if __name__ == '__main__': app.run(debug=True)
""" Copyright 2016 Brian Quach Licensed under MIT (https://github.com/brianquach/udacity-nano-fullstack-catalog/blob/master/LICENSE) # noqa """ from catalog import app app.secret_key = 'development' app.run(host='0.0.0.0', port=8000, debug=False)
from catalog import app app.run(debug= True, host= '0.0.0.0', port = 9080)
from catalog import app app.config['SECRET_KEY'] = 'super secret key' app.run(host="0.0.0.0", port=int("8000"), debug=True)
#!/usr/bin/env python from catalog import app import argparse import os parser = argparse.ArgumentParser() parser.add_argument('-s', '--setup', help='Set up the database for this web app', action="store_true") parser.add_argument('-t', '--test', help='Add some test data', action="store_true") parser.add_argument('-c', '--clean', help='Delete cache files & all the stored images', action="store_true") parser.parse_args() args = parser.parse_args() if args.setup: from catalog.models import database_setup if args.test: from catalog import models models.test() if args.clean: os.system("find ./catalog/static/image -type f -not -name 'avatar.JPG' | xargs rm") os.system("find . -type f -name '*.pyc' | xargs rm") os.system("find . -type d -name '__pycache__' | xargs rm -r") os.system("rm catalog.db") if not args.setup and not args.test and not args.clean: if __name__ == "__main__": app.run(host="0.0.0.0", port=8000, debug=True)
from catalog import app app.run(debug=False) app.run(host='0.0.0.0', port=8000)
import os from catalog import app app.run(debug=True, host=os.environ.get('CATALOG_HOST'), port=os.environ.get('CATALOG_PORT'))
from catalog import app if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=5000)
from catalog import app if __name__ == '__main__': app.run()
from catalog import app if __name__ == "__main__": app.secret_key = 'super_secret_key' app.run(host="http://34.204.53.135/")
from catalog import app import uuid """ Item Catalog project main app. Run this file as 'python catalog_app.py' to initialize the server. Before running this app, ensure that the database is setup by running 'database_setup.py'. Adding initial fake data is optional by running 'fake_data.py'. Project repository and more details at: https://github.com/Ripley6811/FSND-P3-Item-Catalog """ app.start_session() app.secret_key = uuid.uuid4().hex # 'secret_key' app.run(host='0.0.0.0', port=8000, debug=True)
#!/usr/bin/python from catalog import app if __name__ == "__main__": app.run(host = '0.0.0.0')
parser.add_argument('-t', '--test', help='Add some test' 'data', action="store_true") parser.add_argument('-c', '--clean', help='Delete cache files & all the' ' stored images', action="store_true") parser.parse_args() args = parser.parse_args() if args.setup: from catalog.models import database_setup if args.test: from catalog import models models.test() if args.clean: os.system("find ./catalog/static/image -type f -not -name 'avatar.JPG' " "| xargs rm") os.system("find . -type f -name '*.pyc' | xargs rm") os.system("find . -type d -name '__pycache__' | xargs rm -r") os.system("rm catalog.db") if not args.setup and not args.test and not args.clean: if __name__ == "__main__": app.run(host="0.0.0.0", port=8000, debug=True)
from catalog import app app.secret_key = "asecret" app.debug = True app.run(host="0.0.0.0", port=8000)
def main(): app.secret_key = app.config['SECRET_KEY'] app.db_uri = app.config['DB_URI'] app.run(host='0.0.0.0', port=5000, debug=True)
from catalog import app app.secret_key = 'secret_key' app.run(host='0.0.0.0', port=8000, debug=True)
from catalog import app # starting point of the app app.secret_key = 'super_secret_key_1' app.debug = True app.run(host='0.0.0.0', port=8000)
""" This script runs the catalog application using a development server. """ from os import environ from catalog import app if __name__ == '__main__': HOST = environ.get('SERVER_HOST', 'localhost') app.run(HOST, 53224)
"""Main Python script that starts the catalog app. It checks to see if the database file exists and if not it creates the database and populates it with some sample content, for demonstration purposes. """ import os.path from catalog import app from catalog.database_setup import createDB from catalog.populate_data import populateData if __name__ == '__main__': # App configuration app.config['DATABASE_URL'] = 'sqlite:///womenswearcatalog.db' # app.config['DATABASE_URL'] = 'postgresql://*****:*****@localhost/catalog' app.config['UPLOAD_FOLDER'] = '/vagrant/catalog/catalog/item_images' app.config['OAUTH_SECRETS_LOCATION'] = '' app.config['ALLOWED_EXTENSIONS'] = set(['jpg', 'jpeg', 'png', 'gif']) app.config['MAX_CONTENT_LENGTH'] = 4 * 1024 * 1024 # 4 MB app.secret_key = 'super_secret_key' if app.config['DATABASE_URL'] == 'sqlite:///womenswearcatalog.db': if os.path.isfile('womenswearcatalog.db') is False: createDB(app.config['DATABASE_URL']) populateData() else: # for postgresql createDB(app.config['DATABASE_URL']) populateData() app.debug = True app.run(host='0.0.0.0', port=5000)
def serve(): app.run(debug=True)