开发者

Python authentication system for a framework with no authentication built in (like web.py)?

开发者 https://www.devze.com 2023-02-25 02:41 出处:网络
I\'m looking at building a website using Web.py, and there is no built-in authentication system.Having read various things about authentication on websites, a common theme I keep hearing is \"Don\'t r

I'm looking at building a website using Web.py, and there is no built-in authentication system. Having read various things about authentication on websites, a common theme I keep hearing is "Don't roll your own, use someone else's." There are some examples of simple authentication on the site, like this one, but they a开发者_运维问答ll say at the bottom "Don't use this in production code."

So then, is there a generic authentication library for Python that I could use with Web.py? Or, is it really not that hard to roll my own?


If you can't find one easily, then probably discarding the advice and rolling your own is not a bad choice.

I don't think you'll find anything out of the box. The authentication system, is coupled with and dependent on the architecture (in your case probably it is Web only). Having said that it'll perhaps be easier to integrate django's authentication (django.contrib.auth) by putting some hooks here and there with web.py. Even then, it'll import a lot of django'ish ORM and other stuff behind the scene, but it is definitely possible.


Try repoze.who / what - it's implemented as WSGI middleware, so should fit into your stack well.

0

精彩评论

暂无评论...
验证码 换一张
取 消