本文整理汇总了Python中sentry.models.User.is_superuser方法的典型用法代码示例。如果您正苦于以下问题:Python User.is_superuser方法的具体用法?Python User.is_superuser怎么用?Python User.is_superuser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sentry.models.User
的用法示例。
在下文中一共展示了User.is_superuser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: configure
# 需要导入模块: from sentry.models import User [as 别名]
# 或者: from sentry.models.User import is_superuser [as 别名]
#!/srv/sentry/application/current/bin/python
{% from "sentry/map.jinja" import sentry with context %}
from sentry.utils.runner import configure
configure()
from sentry.models import Team, Project, ProjectKey, User, Organization
user = User()
user.username = '{{sentry.bootstrap.username}}'
user.email = '{{sentry.bootstrap.email}}'
user.is_superuser = True
user.set_password('{{sentry.bootstrap.password}}')
user.save()
organization = Organization()
organization.name = '{{sentry.bootstrap.organization}}'
organization.owner = user
organization.save()
team = Team()
team.organization = organization
team.name = '{{sentry.bootstrap.team}}'
team.owner = user
team.save()
project = Project()
project.organization = organization
project.team = team
project.owner = user
project.name = '{{sentry.bootstrap.project}}'