Esempio n. 1
0
    def create_app(self):
        """Create and return a testing flask app."""

        app = create_app(TestConfig)
        self.twill = Twill(app, port=3000)
        return app
Esempio n. 2
0
# -*- coding: utf-8 -*-

from flask.ext.script import Manager

from lurcat import create_app
from lurcat.addons.extensions import db
from lurcat.addons.utils import MALE
from lurcat.modules.user import User, UserDetail, ADMIN, ACTIVE


app = create_app()
manager = Manager(app)


@manager.command
def run():
    """Run in local machine."""

    app.run(host='0.0.0.0')


@manager.command
def initdb():
    """Init/reset database."""

    db.drop_all()
    db.create_all()

    admin = User(
            name=u'admin',
            email=u'*****@*****.**',
Esempio n. 3
0
# -*- coding: utf-8 -*-

import sys, os, pwd

project = "fbone"

# Use instance folder, instead of env variables.
# specify dev/production config
#os.environ['%s_APP_CONFIG' % project.upper()] = ''
# http://code.google.com/p/modwsgi/wiki/ApplicationIssues#User_HOME_Environment_Variable
#os.environ['HOME'] = pwd.getpwuid(os.getuid()).pw_dir

BASE_DIR = os.path.join(os.path.dirname(__file__))
# Change this later, get path from cookiecutter
activate_this = (os.environ['WORKON_HOME'] + 'env' + '/bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))

if BASE_DIR not in sys.path:
    sys.path.append(BASE_DIR)

# give wsgi the "application"
from lurcat import create_app
application = create_app()
Esempio n. 4
0
    def create_app(self):
        """Create and return a testing flask app."""

        app = create_app(TestConfig)
        self.twill = Twill(app, port=3000)
        return app