def main(): app_name = path.basename(getcwd()) app = create_app(Config()) create_views(app_name, app) extend_pages(app_name) if len(sys.argv[1:]) > 0: create_scripts(app).run() else: #import webbrowser # from subprocess import Popen app.init() def live_rebuild(): """ Call the build script to generate the static website content :return: """ site_generator = SiteGenerator(app) site_generator.run() #webbrowser.open_new_tab('http://localhost:5500') keep_alive(app, live_rebuild) return app
def main(): app_name = path.basename(getcwd()) app = create_app(Config()) create_views(app_name, app) extend_pages(app_name) if len(sys.argv[1:]) > 0: create_scripts(app).run() else: import webbrowser # from subprocess import Popen app.init() def live_rebuild(): """ Call the build script to generate the static website content :return: """ site_generator = SiteGenerator(app) site_generator.run() webbrowser.open_new_tab('http://localhost:5500') keep_alive(app, live_rebuild) return app
def main(): check_django_installed() delete_previous_app() create_app() build_template_folders() create_urls() create_views()
def create_app(debug): app = Flask(__name__) app.secret_key = os.environ.get('SECRET_KEY', 'development_fallback') app.debug = debug (app.db_session, app.db_metadata, app.db_engine) = init_db() create_views(app) return app
def create_app(debug, database_url): app = Flask(__name__) app.secret_key = os.environ.get('SECRET_KEY', 'development_fallback') app.debug = debug (app.db_session, app.db_metadata, app.db_engine) = init_db(database_url) create_bundles(app) create_views(app) return app
def main(): app = Flask(__name__) app.config['SECRET_KEY'] = 'secret!' db.init_app(app) init_login(app) init_admin_view(app, db) with app.app_context(): db.create_all() main_view = views.create_views() app.register_blueprint(url_prefix = '/', blueprint = main_view) socketio = SocketIO(app) socketio.run(app, '0.0.0.0', 8080)
from flask import Flask from flask.ext.celery import Celery import db import dbModels import views app = Flask(__name__) app.config['CELERY_BROKER_URL'] = "amqp://localhost" app.config['CELERY_RESULT_BACKEND'] = "amqp://localhost" celery = Celery(app) database = db.Db() if __name__ == '__main__': dbModels.create_tables(database) views.create_views(app, database) app.debug = True app.run(host="0.0.0.0")
def create_default_views(self): views.create_views(self)
from flask import Flask from flask_session import Session from views import create_views from quickbooks_api import auth_url, auth_client app = Flask(__name__) # Config SESSION_TYPE = 'filesystem' SECRET_KEY = 'random string for secrets' app.config.from_object(__name__) Session(app) # Create the views for the app views = create_views({ 'url': auth_url, 'client': auth_client }) # Register the views app.register_blueprint(views) if __name__ == '__main__': app.run(debug=True, host="localhost", port=5000)