def initialize(): init() create_tables() NetworkStore.initialize() ClientStore.initialize() ChannelStore.initialize() UserStore.initialize() MessageLogStore.initialize() ActivityLogStore.initialize()
def initialize(): create_tables() NetworkStore.initialize() ClientStore.initialize() ChannelStore.initialize() UserStore.initialize()
def register(): form = RegisterForm(request.form) if request.method == 'POST' and form.validate(): username = request.form.get('username') email = request.form.get('email') password = request.form.get('password') user = User(username=username, email=email, password=password) db.add(user) db.commit() subprocess.check_output( [conf.LOUNGE_BINARY, 'add', user.username, password]) if user and user.authenticate(password): login_user(user) return redirect(url_for('add_network')) # somewhere to logout @app.route("/logout") @login_required def logout(): logout_user() return redirect(url_for('index')) if __name__ == '__main__': from ircb.models import create_tables create_tables() app.run(debug=True)
from flask import Flask from ircb.config import settings from ircb.models import get_session, create_tables app = Flask(__name__) if __name__ == '__main__': create_tables() session = get_session(settings.DB_URI) app.run()