示例#1
0
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
示例#2
0
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
示例#3
0
def main():
    check_django_installed()
    delete_previous_app()
    create_app()
    build_template_folders()
    create_urls()
    create_views()
示例#4
0
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
示例#5
0
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
示例#6
0
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)
示例#7
0
文件: app.py 项目: varesa/rpmmanage
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")
示例#8
0
 def create_default_views(self):
     views.create_views(self)
示例#9
0
 def create_default_views(self):
     views.create_views(self)
示例#10
0
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)