本文整理汇总了Python中app.helpers.data.DataManager.create_super_admin方法的典型用法代码示例。如果您正苦于以下问题:Python DataManager.create_super_admin方法的具体用法?Python DataManager.create_super_admin怎么用?Python DataManager.create_super_admin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.helpers.data.DataManager
的用法示例。
在下文中一共展示了DataManager.create_super_admin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_default_user
# 需要导入模块: from app.helpers.data import DataManager [as 别名]
# 或者: from app.helpers.data.DataManager import create_super_admin [as 别名]
def create_default_user():
print "Your login is 'super_admin'."
email = raw_input("Enter email for super_admin : ")
_validate_email(email)
password = getpass("Enter password for super_admin : ")
_validate_password(password)
DataManager.create_super_admin(email, password)
示例2: create_default_user
# 需要导入模块: from app.helpers.data import DataManager [as 别名]
# 或者: from app.helpers.data.DataManager import create_super_admin [as 别名]
def create_default_user():
print "Your login is 'super_admin'."
email = raw_input("Enter email for super_admin : ")
_validate_email(email)
getpass.os = eventlet.patcher.original('os')
password = getpass.getpass("Enter password for super_admin : ")
_validate_password(password)
DataManager.create_super_admin(email, password)
示例3: initialize_db
# 需要导入模块: from app.helpers.data import DataManager [as 别名]
# 或者: from app.helpers.data.DataManager import create_super_admin [as 别名]
def initialize_db(credentials):
with app.app_context():
populate_data = True
inspector = reflection.Inspector.from_engine(db.engine)
table_name = 'events'
table_names = inspector.get_table_names()
if table_name not in table_names:
try:
db.create_all()
stamp()
except:
populate_data = False
print "Could not create tables. Either database does not exist or tables already created"
if populate_data:
credentials = credentials.split(":")
DataManager.create_super_admin(credentials[0], credentials[1])
populate()
示例4: initialize_db
# 需要导入模块: from app.helpers.data import DataManager [as 别名]
# 或者: from app.helpers.data.DataManager import create_super_admin [as 别名]
def initialize_db(credentials):
with app.app_context():
db.create_all()
credentials = credentials.split(":")
DataManager.create_super_admin(credentials[0], credentials[1])
populate()