from flask_mail import Mail
from flask_sslify import SSLify
from flask.ext.assets import Environment, Bundle
from flask_errormail import mail_on_500

from flask.ext.track_usage import TrackUsage
from flask.ext.track_usage.storage.printer import PrintStorage
from flask.ext.track_usage.storage.mongo import MongoStorage

app = Flask(__name__)
app.config["MONGODB_SETTINGS"] = {'db': ""} # Place MongoDB settings
app.config["SECRET_KEY"] = ""

# Flask-Security
app.config["SECURITY_CONFIRMABLE"] = True
app.config["SECURITY_TRACKABLE"] = True
app.config["SECURITY_REGISTERABLE"] = True
app.config["SECURITY_RECOVERABLE"] = True
app.config["SECURITY_CHANGEABLE"] = True
app.config["SECURITY_REGISTER_USER_TEMPLATE"] = 'accounts/register.html'
app.config["SECURITY_LOGIN_USER_TEMPLATE"] = 'accounts/login.html'
app.config["SECURITY_FORGOT_PASSWORD_TEMPLATE"] = 'accounts/forgot-password.html'
app.config["SECURITY_CHANGE_PASSWORD_TEMPLATE"] = 'accounts/change-password.html'
app.config["SECURITY_SEND_REGISTER_EMAIL"] = False
app.config["SECURITY_SEND_PASSWORD_CHANGE_EMAIL"] = False
app.config["SECURITY_SEND_PASSWORD_RESET_NOTICE_EMAIL"] = False
app.config["SECURITY_PASSWORD_HASH"] = 'sha512_crypt'
app.config["SECURITY_PASSWORD_SALT"] = '' # Set password salt

# Flask-Mail
app.config['MAIL_SERVER'] = 'smtp.gmail.com'