diff --git a/development.ini b/development.ini index db85be5..4b90136 100644 --- a/development.ini +++ b/development.ini @@ -38,6 +38,10 @@ paths.images = %(here)s/images # Themes directory paths.themes = %(here)s/themes +default.user.password = p4ssw0rd +default.user.email = admin@scribeengine.org +default.user.nick = Admin + # Security settings security.salt = secretsalt diff --git a/scribeengine/websetup.py b/scribeengine/websetup.py index cc90443..5e9bd66 100644 --- a/scribeengine/websetup.py +++ b/scribeengine/websetup.py @@ -57,10 +57,10 @@ def setup_app(command, conf, vars): role_admin = Role(name=u'Administrator') role_admin.permissions.extend([perm_addposts, perm_editmyposts, perm_delmyposts]) - password = unicode(hmac.new(conf[u'security.salt'], u'password', + password = unicode(hmac.new(conf[u'security.salt'], conf[u'default.user.password'], hashlib.sha256).hexdigest(), u'utf-8') - user = User(email=u'admin@scribeengine.org', - password=password, nick=u'admin') + user = User(email=conf[u'default.user.email'], + password=password, nick=conf[u'default.user.nick']) user.roles.append(role_admin) Session.add_all([blog_title, blog_slogan, user])