adding password encryption to increase security

This commit is contained in:
Andrew Davidson 2014-12-28 16:50:25 -08:00
parent 041b490e7f
commit 023eb1529e

View file

@ -9,6 +9,7 @@ import urllib
from subprocess import call
from bs4 import BeautifulSoup as BS
from xml.sax.saxutils import escape
from flask.ext.security.utils import encrypt_password
app = Flask(__name__)
@ -19,7 +20,8 @@ app.config["MONGODB_DB"] = "bookie"
app.config['SECRET_KEY'] = 'bobloblawlawblog'
app.config['UPLOAD_FOLDER'] = "static/uploads"
app.config['SITE_URL'] = "http://localhost:5000"
app.config['SECURITY_PASSWORD_HASH'] = "bcrypt"
app.config['SECURITY_PASSWORD_SALT'] = "asdfiqwnvonaosinva"
#####
# MongoDB Setup
@ -42,6 +44,9 @@ class User(db.Document, UserMixin):
confirmed_at = db.DateTimeField()
roles = db.ListField(db.ReferenceField(Role), default=[])
def encrypt_password(self, pw):
return encrypt_password(pw)
class Tag(db.Document):
name = db.StringField(required=True, max_length=25, unique=True)
note = db.StringField(required=False, max_length=100)