Ejemplo n.º 1
0
Archivo: cli.py Proyecto: 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)
Ejemplo n.º 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)
Ejemplo n.º 3
0
Archivo: cli.py Proyecto: 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)
Ejemplo n.º 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)
Ejemplo n.º 5
0
"""
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)
Ejemplo n.º 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()
Ejemplo n.º 7
0
 def setUp(self):
     app = create_app(Path(os.getcwd()).parent.parent)
     self.app = app
     self.client = app.test_client()
Ejemplo n.º 8
0
 def app(self):
     if not self._app:
         self._app = create_app(self.rootdir).test_client()
     return self._app
Ejemplo n.º 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()
Ejemplo n.º 10
0
 def app(self):
     if not self._app:
         self._app = create_app(self.rootdir).test_client()
     return self._app