GAE 上的 B2B 应用程序身份验证 - Google 帐户或自定义用户群(Django 或 Web2Py)?
对于使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我从 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.
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
为什么都从 Google 用户创建 Django 用户。接下来您将能够使您的系统用户与其他系统相适应
Why both Create Django user from Google users. you will be able to adapt your system user with other system next
在我写完这篇文章后,我明白这个问题只是关于身份验证,所以这里的大部分内容都是题外话,但我只是想放弃在 appengine 中使用 django 或 web2py 等全栈解决方案的动力。
我可以告诉你一些关于 django 的事情,因为我已经使用它一年多了,并且我确实喜欢它用于某些类型的网站。这是我尝试在 appengine 上使用的第一个框架,两周后我就放弃了它。
这些是 django 中的东西在 appengine 中不起作用或没有意义:
存在 django-nonrel 项目,该项目表示它可以在 appengine 上通过管理站点运行 django。它可以,一半的东西可以工作,但有很多错误。你花更多的时间尝试修复不起作用的东西,而不是构建东西。
django 框架可能有用的内容:
ctypes
模块来调试 jinja 模板中的错误,但是ctypes
在 appengine 上是被禁止的,但是 在开发服务器上它确实可以工作,对于调试,您不需要更多。实际上 Jinja2、Werkzeug、WTForms 和 babel 都非常酷,以至于它们都有与 django 集成的项目。
我知道两个使用这些库的框架:
我没有使用过 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:
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:
ctypes
module is required to debug errors in jinja templates, howeverctypes
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:
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.