with self.lock: if host in self.hosts: return self.app else: return self.eventapp def __call__(self, environ, start_response): app = self.get_application(environ['HTTP_HOST']) return app(environ, start_response) # Second, make the main and event apps and configure them app = Flask(__name__, instance_relative_config=True) eventapp = Flask(__name__, instance_relative_config=True, template_folder='themes-templates') configure(app, 'ENVIRONMENT') configure(eventapp, 'ENVIRONMENT') # Third, after config, import and configure the models and views import eventframe.models import eventframe.views eventframe.models.db.init_app(app) eventframe.models.db.init_app(eventapp) # Fourth, setup baseframe, assets and theme assets on both apps app.register_blueprint(baseframe)
'apps', 'auth', 'client', 'confirm', 'login', 'logout', 'new', 'profile', 'reset', 'register', 'token', 'organizations', ]) app = Flask(__name__, instance_relative_config=True) configure(app, 'LASTUSER_ENV') app.register_blueprint(baseframe) assets = Environment(app) js = Bundle(baseframe_js, cookie_js, timezone_js, 'js/app.js', filters='jsmin', output='js/packed.js') css = Bundle(baseframe_css, 'css/app.css', filters='cssmin', output='css/packed.css') assets.register('js_all', js) assets.register('css_all', css) import lastuserapp.registry import lastuserapp.mailclient
def test_configure(self): env = 'COASTER_ENV' environ[env] = "testing" configure(self.app, env) self.assertEqual(self.app.config['SETTINGS_KEY'], "settings") self.assertEqual(self.app.config['TEST_KEY'], "test")
'apps', 'auth', 'client', 'confirm', 'login', 'logout', 'new', 'profile', 'reset', 'register', 'token', 'organizations', ]) app = Flask(__name__, instance_relative_config=True) configure(app, 'LASTUSER_ENV') app.register_blueprint(baseframe) assets = Environment(app) js = Bundle(baseframe_js, cookie_js, timezone_js, 'js/app.js', filters='jsmin', output='js/packed.js') css = Bundle(baseframe_css, 'css/app.css', filters='cssmin', output='css/packed.css')
"auth", "client", "confirm", "login", "logout", "new", "profile", "reset", "register", "token", "organizations", ] ) app = Flask(__name__, instance_relative_config=True) configure(app, "LASTUSER_ENV") app.register_blueprint(baseframe) assets = Environment(app) js = Bundle(baseframe_js, cookie_js, timezone_js, "js/app.js", filters="jsmin", output="js/packed.js") css = Bundle(baseframe_css, "css/app.css", filters="cssmin", output="css/packed.css") assets.register("js_all", js) assets.register("css_all", css) import lastuserapp.registry import lastuserapp.mailclient import lastuserapp.models import lastuserapp.forms
# -*- coding: utf-8 -*- """ Website server for metarefresh. """ from flask import Flask from flask.ext.assets import Environment, Bundle from baseframe import baseframe, baseframe_js, baseframe_css #from os import environ from coaster.app import configure # First, make an app and config it app = Flask(__name__, instance_relative_config=True) configure(app, 'METAREFRESH_ENV') app.register_blueprint(baseframe) assets = Environment(app) js = Bundle(Bundle(baseframe_js, 'js/jquery.smooth-scroll.min.js', 'js/metarefresh.js', filters='jsmin', output='js/metarefresh-packed.js'), 'js/leaflet/leaflet.js') css = Bundle(Bundle(baseframe_css, 'css/metarefresh.css', 'css/responsive.css', filters='cssmin', output='css/metarefresh-packed.css'), 'js/leaflet/leaflet.css') assets.register('js_all', js) assets.register('css_all', css) import metarefresh.views #if environ.get('METAREFRESH_ENV') == 'prod': # import metarefresh.loghandler
# -*- coding: utf-8 -*- # The imports in this file are order-sensitive from flask import Flask from flask.ext.assets import Environment, Bundle from baseframe import baseframe, baseframe_js, baseframe_css from coaster.app import configure # First, make an app and config it app = Flask(__name__, instance_relative_config=True) configure(app, 'HGTV_ENV') # Second, setup baseframe and assets app.register_blueprint(baseframe) assets = Environment(app) js = Bundle(baseframe_js) css = Bundle(baseframe_css, 'css/hgtv.css') assets.register('js_all', js) assets.register('css_all', css) # Third, after config, import the models and views import hgtv.models import hgtv.views
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Website server for fifthelephant. """ from flask import Flask from flask.ext.assets import Environment, Bundle from baseframe import baseframe, baseframe_js, baseframe_css #from os import environ from coaster.app import configure # First, make an app and config it app = Flask(__name__, instance_relative_config=True) configure(app, 'FIFTHELEPHANT_ENV') app.register_blueprint(baseframe) assets = Environment(app) js = Bundle(Bundle(baseframe_js, 'js/jquery.smooth-scroll.min.js', 'js/plax.js', 'js/fifthelephant.js'), 'js/leaflet/leaflet.js') css = Bundle(baseframe_css, 'css/fifthelephant.css', 'js/leaflet/leaflet.css') assets.register('js_all', js) assets.register('css_all', css) import fifthelephant.views #if environ.get('FIFTHELEPHANT_ENV') == 'prod': # import fifthelephant.loghandler
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Website server for fifthelephant. """ from flask import Flask from flask.ext.assets import Environment, Bundle from baseframe import baseframe, baseframe_js, baseframe_css #from os import environ from coaster.app import configure # First, make an app and config it app = Flask(__name__, instance_relative_config=True) configure(app, 'FIFTHELEPHANT_ENV') app.register_blueprint(baseframe) assets = Environment(app) js = Bundle( Bundle(baseframe_js, 'js/jquery.smooth-scroll.min.js', 'js/plax.js', 'js/fifthelephant.js'), 'js/leaflet/leaflet.js') css = Bundle(baseframe_css, 'css/fifthelephant.css', 'js/leaflet/leaflet.css') assets.register('js_all', js) assets.register('css_all', css) import fifthelephant.views #if environ.get('FIFTHELEPHANT_ENV') == 'prod': # import fifthelephant.loghandler
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Website server for metarefresh. """ from flask import Flask from flask.ext.assets import Environment, Bundle from baseframe import baseframe, baseframe_js, baseframe_css #from os import environ from coaster.app import configure # First, make an app and config it app = Flask(__name__, instance_relative_config=True) configure(app, 'METAREFRESH_ENV') app.register_blueprint(baseframe) assets = Environment(app) js = Bundle( Bundle(baseframe_js, 'js/jquery.smooth-scroll.min.js', 'js/metarefresh.js', filters='jsmin', output='js/metarefresh-packed.js'), 'js/leaflet/leaflet.js') css = Bundle( Bundle(baseframe_css, 'css/metarefresh.css', 'css/responsive.css', filters='cssmin', output='css/metarefresh-packed.css'), 'js/leaflet/leaflet.css')