GAE 和 django 的管理员

发布于 2025-01-03 03:55:35 字数 381 浏览 2 评论 0原文

我正在开发一个谷歌应用程序引擎和基于 django 的网站,我试图弄清楚什么是 解决该问题的最佳方法,站点要求如下:

  1. 必须有一个超级管理员,其唯一任务是创建二级管理员并将其分配到一个组。
  2. 二级管理员可以创建常规用户,这些用户会被分配到创建它们的管理员所在的同一组。
  3. 普通用户除了登录和注销之外不需要做太多事情。

我一直在阅读,我认为我可以使用 app.yaml 的(登录:admin)GAE 功能来解决 1。

我不想使用 openid 之外的 google 帐户,因为二级管理员是 唯一允许创建的用户。

3. 是否可以使用 django 会话实用程序来处理普通用户?

我很乐意就某一点或整个事情提出建议。

Im developing a google app engine and django based site and i'm tring to figure out what's
the best approach to solve the problem, the site requirments are as follows:

  1. There must be a super administrator who's only task is to create second level administrators and assign them to a group.
  2. Second level administrators can create regular users and those users are assigded to the same group from the admin that created them.
  3. Regular users don't do much besides login and logout.

I've been reading and i think i can solve 1 with the (login: admin) GAE feature for app.yaml.

I don't want to use google accounts neigther openid because second level admins are
the only allowed to create users.

For 3. Is it possible to use django session utility to handle regular users ?

I'd appreciate suggestion for a particular point or the whole thing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尤怨 2025-01-10 03:55:35

对于 1:
app.yaml 中的 login:admin 将阻止与您的 GAE 项目无关的用户访问该 URL 或 URL 集。与您的 GAE 生产项目关联的任何用户都是管理员。您可以通过确认他们当前登录的用户名来在应用程序内创建额外的过滤。

from google.appengine.api import users
user = users.get_current_user()
email = user.email()

对于 3:
我不确定,我们最终推出了自己的。

For 1:
login:admin in app.yaml will prevent users that are not associated with your GAE project from visiting that URL or set of URLs. Any user associated with your GAE production project is an admin. You can create additional filtering inside the application by confirming the username that they are currently logged in with.

from google.appengine.api import users
user = users.get_current_user()
email = user.email()

For 3:
I am not sure, we ended up rolling our own.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文