def create_app(self): self.tmp_dir = tempfile.mkdtemp() self.db_filename = os.path.join(self.tmp_dir, "db.sqlite") config = { # I hate the author of Flask-WTF for changing the name of the # configuration parameter. 'WTF_CSRF_ENABLED': False, 'CSRF_ENABLED': False, 'SQLALCHEMY_DATABASE_URI': "sqlite:///%s" % self.db_filename, 'SECRET_KEY': 'test', 'TESTING': True, } return main.create_app(config)
def create_app(self): self.tmp_dir = tempfile.mkdtemp() self.db_filename = os.path.join(self.tmp_dir, "db.sqlite") config = { "WTF_CSRF_ENABLED": False, "SQLALCHEMY_DATABASE_URI": "sqlite:///%s" % self.db_filename, "SECRET_KEY": "test", "TESTING": True, "BABEL_DEFAULT_LOCALE": "en", "BABEL_DEFAULT_TIMEZONE": "UTC", "LIVESERVER_PORT": 0, } return main.create_app(config)
def main(): from optparse import OptionParser from qstode.main import create_app parser = OptionParser() parser.add_option('-c', '--config') (opts, args) = parser.parse_args() if not args: parser.error("You must specify a json export file") if not opts.config: parser.error("You must specify a configuration file") os.environ['APP_CONFIG'] = os.path.abspath(opts.config) app = create_app() import_scuttle(args[0])
def create_app(self): self.tmp_dir = tempfile.mkdtemp() self.db_filename = os.path.join(self.tmp_dir, "db.sqlite") config = { # I hate the author of Flask-WTF for changing the name of the # configuration parameter. "WTF_CSRF_ENABLED": False, "CSRF_ENABLED": False, "SQLALCHEMY_DATABASE_URI": "sqlite:///%s" % self.db_filename, "SECRET_KEY": "test", "TESTING": True, "BABEL_DEFAULT_LOCALE": "en", "BABEL_DEFAULT_TIMEZONE": "UTC", } return main.create_app(config)
# -*- coding: utf-8 -*- from qstode.main import create_app # WSGI entry point app = create_app()