from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security

# Create app
app = Flask(__name__)
app.config.from_object('config')

# Create mail object
mail = Mail(app)

from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security

# Create app
app = Flask(__name__)
app.config.from_object('config')

# Create mail object
mail = Mail(app)

# Create database connection object
db = MongoEngine(app)

from edx_data_research.web_app.models import User, Role

# Setup Flask-Security
user_datastore = MongoEngineUserDatastore(db, User, Role)
security = Security(app, user_datastore)

Define flask security object for login stuff
Define flask security object for login stuff
  from flask import Flask
  from flask.ext.mail import Mail
  from flask.ext.mongoengine import MongoEngine
  from flask.ext.security import MongoEngineUserDatastore, Security
  
  # Create app
  app = Flask(__name__)
  app.config.from_object('config')
  
  # Create mail object
  mail = Mail(app)
  
+ # Create database connection object
+ db = MongoEngine(app)
+ 
+ from edx_data_research.web_app.models import User, Role
+ 
+ # Setup Flask-Security
+ user_datastore = MongoEngineUserDatastore(db, User, Role)
+ security = Security(app, user_datastore)
+ 
Define flask security object for login stuff
## Code Before:
from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security

# Create app
app = Flask(__name__)
app.config.from_object('config')

# Create mail object
mail = Mail(app)

## Instruction:
Define flask security object for login stuff
## Code After:
from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mongoengine import MongoEngine
from flask.ext.security import MongoEngineUserDatastore, Security

# Create app
app = Flask(__name__)
app.config.from_object('config')

# Create mail object
mail = Mail(app)

# Create database connection object
db = MongoEngine(app)

from edx_data_research.web_app.models import User, Role

# Setup Flask-Security
user_datastore = MongoEngineUserDatastore(db, User, Role)
security = Security(app, user_datastore)
