GAE 上的 B2B 应用程序身份验证 - Google 帐户或自定义用户群(Django 或 Web2Py)?

发布于 2024-12-21 21:09:49 字数 257 浏览 3 评论 0原文

对于使用 Python 构建在 GAE 上的 B2B 应用程序(针对小型/中小型企业),您会选择以下哪一个:

  • Google 帐户
  • 自定义用户与 Django
  • 自定义用户与 Web2Py

我很想走 Google 帐户路线,因为它非常好集成到 GAE 中,负责处理从用户创建到会话身份验证的所有事务,甚至处理忘记的密码。但是,我确信这样做有很大的缺点,包括可用性,但如果您从头开始,您会选择哪种方法,为什么?

Which of these would you pick for a B2B app (targeting small/med-small businesses) built on GAE with python:

  • Google Accounts
  • Custom Users with Django
  • Custom Users with Web2Py

I'm very tempted to go the Google Accounts route as it's very well integrated into GAE and takes care of everything from user creation to session authentication, and even takes care of forgotten passwords. However, I'm sure there are significant drawbacks to this, including usability, but if you are starting from scratch, which approach would you pick and why?

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

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

发布评论

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

评论(4

戴着白色围巾的女孩 2024-12-28 21:09:49

我从 Google 帐户开始,添加了所有 OpenID,很快发现人们在我的网站上使用的唯一帐户是 google 和 facebook 帐户。所以现在我只能用google登录和用facebook登录。但我要添加我自己的帐户,并且我将使用 webapp2 而不是 django 和 web2py 来完成此操作。我尝试了 web2py,但 webapp2 及其身份验证模型似乎更好,并且不像 web2py 那样有很多不适合应用程序引擎的不必要的代码。

尝试这个及其身份验证模型(有来自 http:// /code.google.com/p/webapp-improved/issues/detail?id=20),我希望它对您有用。

I started with Google account, added all OpenID and quickly found that the only accounts people use for my site are google and facebook accounts. So now I only have login with google and login with facebook. But I'm going to add my own accounts and I'm doing it with webapp2 instead of django and instead of web2py. I tried web2py but webapp2 and its auth model seem much better and not like with web2py a lot of unnecessary code that is not for app engine.

Try this and its auth model (there is example code from http://code.google.com/p/webapp-improved/issues/detail?id=20) and I hope it will work for you.

开始看清了 2024-12-28 21:09:49

Google 帐户强制用户拥有 Google Apps 或 Gmail 帐户。有些客户可能不喜欢这样。

自行部署是一种(不必要的)负担:您必须进行注册流程(使用验证码和/或第 3 方电子邮件确认)、保留所有用户记录、处理安全性等。

我建议您使用 OpenID: http://code.google.com/appengine/docs/python/users/overview.html#Authentication_Options

Google Accounts forces users to have Google Apps or Gmail accounts. Some customers might not like this.

Rolling your own is an (unnecessary) burden: you have to have sign up process (with captcha and/or 3rd party email confirmation), keep all user records, handle the security, etc..

I'd suggest you go with OpenID: http://code.google.com/appengine/docs/python/users/overview.html#Authentication_Options

子栖 2024-12-28 21:09:49

为什么都从 Google 用户创建 Django 用户。接下来您将能够使您的系统用户与其他系统相适应

Why both Create Django user from Google users. you will be able to adapt your system user with other system next

独守阴晴ぅ圆缺 2024-12-28 21:09:49

在我写完这篇文章后,我明白这个问题只是关于身份验证,所以这里的大部分内容都是题外话,但我只是想放弃在 appengine 中使用 django 或 web2py 等全栈解决方案的动力。

我可以告诉你一些关于 django 的事情,因为我已经使用它一年多了,并且我确实喜欢它用于某些类型的网站。这是我尝试在 appengine 上使用的第一个框架,两周后我就放弃了它。

这些是 django 中的东西在 appengine 中不起作用或没有意义:

  • django 模型和 orm:为 sql 设计; appengine sdk 有自己的模型。
  • django 管理站点:专为 sql 数据库设计,不适用于 appengine
  • 模型自动表单:专为 django 模型设计
  • django 管理命令 :在使用 appengine SDK 时,django 附带的命令都没有用处。
  • django开发服务器:appengine sdk有自己的开发服务器,django的开发服务器不起作用。
  • django“可插入应用程序”架构:至少在我的实践中,它在appengine上毫无用处。
  • 静态文件收集器:仅当您有许多可重用应用程序时,才可以将各种可重用应用程序中的静态文件收集到一个文件夹中。

存在 django-nonrel 项目,该项目表示它可以在 appengine 上通过管理站点运行 django。它可以,一半的东西可以工作,但有很多错误。你花更多的时间尝试修复不起作用的东西,而不是构建东西。

django 框架可能有用的内容:

  • django forms:可以换成更好的库 WTForms
  • django url 路由:可以使用 Werkzeug 代替
  • django 请求/响应对象和 HTTP 异常:可以使用 Werkzeug 代替
  • django 漂亮打印异常:Werkzeug 做得更好,它添加 Web 调试器
  • django i18n 和本地化:可以使用 babel
  • django templates: jinja2 类似,而且速度更快,这一点很重要,因为 appengine 是一个昂贵的平台。需要 ctypes 模块来调试 jinja 模板中的错误,但是 ctypes 在 appengine 上是被禁止的,但是 在开发服务器上它确实可以工作,对于调试,您不需要更多。

实际上 Jinja2、Werkzeug、WTForms 和 babel 都非常酷,以至于它们都有与 django 集成的项目。

我知道两个使用这些库的框架:

  • kay-framework:为 appengine 制作,a有点过时了,但这是一个很好的例子,说明如何在 appengine 上使用 Jinja2、babel 和 Werkzeug。
  • flask 来自 Armin Ronacher,Werkzeug 和 Jinja2 背后的人。

我没有使用过 web2py,但是由于它也是一个像 django 一样的全栈框架,我认为它会和 django 一样糟糕。 全栈解决方案根本不适合这种不同的环境。简单的库适合任何环境。

I've understood that question was only on authentication after I've written this so most of things here are offtopic, but I just wanted to demotivate on using full-stack solutions like django or web2py in appengine.

I can tell you something about django because I've used it for over a year and I do like it for certain types of websites. It was first framework which I've tried to use on appengine and I've dropped it after two weeks.

These are things in django which doesn't work or make no sense in appengine:

  • django models and orm: designed for sql; appengine sdk has its own models.
  • django admin site: is designed for sql databases, doesn't work on appengine
  • auto-forms from models: designed for django models
  • django management commands: none of commands which come with django is useful when working with appengine SDK.
  • django development server: appengine sdk has its own development server, django's one does not work.
  • django "plugable apps" architecture: at least in my practice it was useless on appengine.
  • static files collector: great tool to collect static files from various reusable applications into one folder, only if you have many reusable applications.

There exists django-nonrel project which says it can run django with admin site on appengine. It can, with half of things working and a lot of bugs. You spend more time trying to fix what does not work than building things.

What might be useful from django framework:

  • django forms: can be exchanged for a better library WTForms
  • django url routing: can use Werkzeug instead
  • django request/response objects and HTTP exceptions: can use Werkzeug instead
  • django pretty-printing exceptions: Werkzeug does it better, it adds a web debugger.
  • django i18n and localization: can be changed with babel
  • django templates: jinja2 is similar and a lot faster, which is important because appengine is an expensive platform. ctypes module is required to debug errors in jinja templates, however ctypes is forbidden on appengine, but on development server it does work, for debugging you don't need more.

Actually Jinja2, Werkzeug, WTForms and babel are so cool, that there exists projects for each of them which integrates them with django.

I know two frameworks which use these libraries:

  • kay-framework: made for appengine, a bit outdated, but a great example how you can use Jinja2, babel and Werkzeug on appengine.
  • flask from Armin Ronacher, the man behind Werkzeug and Jinja2.

I've not used web2py, however since it is also a full-stack framework like django is, I think it will be as bad as django is. Full-stack solutions simply do not fit in this different environment. Simple libraries fit in any environment.

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