Moved default user settings to config.ini

This commit is contained in:
David Rubin 2010-01-18 22:36:02 +02:00
parent 8a5e979650
commit 35ece0ef38
2 changed files with 7 additions and 3 deletions

View File

@ -38,6 +38,10 @@ paths.images = %(here)s/images
# Themes directory # Themes directory
paths.themes = %(here)s/themes paths.themes = %(here)s/themes
default.user.password = p4ssw0rd
default.user.email = admin@scribeengine.org
default.user.nick = Admin
# Security settings # Security settings
security.salt = secretsalt security.salt = secretsalt

View File

@ -57,10 +57,10 @@ def setup_app(command, conf, vars):
role_admin = Role(name=u'Administrator') role_admin = Role(name=u'Administrator')
role_admin.permissions.extend([perm_addposts, perm_editmyposts, perm_delmyposts]) 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') hashlib.sha256).hexdigest(), u'utf-8')
user = User(email=u'admin@scribeengine.org', user = User(email=conf[u'default.user.email'],
password=password, nick=u'admin') password=password, nick=conf[u'default.user.nick'])
user.roles.append(role_admin) user.roles.append(role_admin)
Session.add_all([blog_title, blog_slogan, user]) Session.add_all([blog_title, blog_slogan, user])