示例#1
0
文件: cli.py 项目: johniez/wiki
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)
示例#2
0
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)
示例#3
0
文件: cli.py 项目: alexex/wiki
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)
示例#4
0
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)
示例#5
0
文件: run.py 项目: tobyqin/pywiki
"""
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)
示例#6
0
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()
示例#7
0
 def setUp(self):
     app = create_app(Path(os.getcwd()).parent.parent)
     self.app = app
     self.client = app.test_client()
示例#8
0
 def app(self):
     if not self._app:
         self._app = create_app(self.rootdir).test_client()
     return self._app
示例#9
0
 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()
示例#10
0
文件: __init__.py 项目: alexex/wiki
 def app(self):
     if not self._app:
         self._app = create_app(self.rootdir).test_client()
     return self._app