This commit is contained in:
Oleg Podsadny 2013-06-07 23:33:28 +02:00
parent b32202dd5b
commit 1083a8f9f4
2 changed files with 14 additions and 8 deletions

View File

@ -1,4 +1,4 @@
from flask import Flask, Blueprint
from flask import Flask
from flask.ext.admin import Admin
from flask.ext.login import LoginManager
from flask.ext.sqlalchemy import SQLAlchemy
@ -16,14 +16,16 @@ from flask.ext.admin.contrib.sqlamodel import ModelView
from pytest_bdd_example import dashboard
from pytest_bdd_example.dashboard.models import User
# app.register_blueprint(dashboard.bp, url_prefix='/dashboard')
# login_manager.init_app(app)
app.register_blueprint(dashboard.bp, url_prefix='/dashboard')
# @login_manager.user_loader
# def load_user(userid):
# return User.get(userid)
login_manager.init_app(app)
@login_manager.user_loader
def load_user(userid):
return User.get(userid)
admin_panel = Admin(app)
admin_panel.add_view(ModelView(User, db.session, endpoint='users'))
admin_panel.add_view(ModelView(User, db.session, endpoint='users'))

View File

@ -26,7 +26,11 @@ setup(
version='0.1',
cmdclass={'test': PyTest},
install_requires=[
'flask-auth',
'flask-admin',
'flask-script',
'flask-login',
'flask-security',
'flask-sqlalchemy',
],
tests_require=[
'pytest-bdd-splinter',