def web(ctx, debug): """ Run the web app. \b :param bool debug: whether or not to run the web app in debug mode. """ app = create_app(ctx.meta['directory']) app.run(debug=debug)
def web(ctx, debug): """ Run the web app. \b :param bool debug: whether or not to run the web app in debug mode. """ app = create_app(ctx.meta['directory']) app.run(host='0.0.0.0', debug=debug)
def web(ctx, debug, host, port): """ Run the web app. \b :param bool debug: whether or not to run the web app in debug mode. :param str host: Set the host to 0.0.0.0 to connect from outside. The default is 127.0.0.1. :param int port: Set the listening port. The default is 5000. """ app = create_app(ctx.meta['directory']) app.run(debug=debug, host=host, port=port)
""" To run and debug locally. """ import os from os import path from shutil import copyfile from wiki.web import create_app content_dir = path.join(path.dirname(__file__), 'content') if not path.exists(content_dir): os.mkdir(content_dir) copyfile('config.example.py', './content/config.py') app = create_app(content_dir) app.run(debug=True, host='127.0.0.1', port=5000)
import os import click from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from wiki.web import create_app, db from wiki.web import models directory = os.getcwd() directory = os.path.abspath(click.format_filename(directory)) app = create_app(directory) migrate = Migrate(app, db) manager = Manager(app) manager.add_command('db', MigrateCommand) if __name__ == '__main__': manager.run()
def setUp(self): app = create_app(Path(os.getcwd()).parent.parent) self.app = app self.client = app.test_client()
def app(self): if not self._app: self._app = create_app(self.rootdir).test_client() return self._app
def setUp(cls): setup_testing_directory(os.getcwd()) app = create_app(Path(os.getcwd()).parent.parent) app.config['USER_DIR'] = os.getcwd() + "/testing/" cls.app = app cls.client = app.test_client()