Python Web Authentication (I must be missing something...)

Status
Not open for further replies.

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
So, my latest work involves building a (crude) web-based GUI (and eventually, some web services) for this new application we're developing. The GUI will be pretty simple, essentially a way to provide input to execute a bunch of computationally expensive command-line applications remotely and then view their output.

As such, I don't need much from a web framework. I don't need ORM or any other database capability. (in fact, there likely won't be a database at all). My controller / routing needs won't be especially complicated, as all pages will do more or less the same thing: submit a job to the processing queue or view the output of a job. My template / view needs will not be especially complicated, at least initially.

The one thing I do need pretty desperately though is authentication. Authentication is something I have zero desire to deal with, and something that no one else in our group wants to deal with either. Unfortunately, it appears we have no choice in the matter. My hope was that I could find a pre-made solution for creating and managing user accounts and handling the login process for me, so that I all I had to do was write a few forms and make a few library calls to make it all work (ala ASP.NET). Sadly, such a thing doesn't seem to really exist, unless I use full-on Django, TurboGears, web2py et al. I could do that (may end up doing that), but I really haven't been impressed by any of them. I take on a lot of infrastructure and complication for things I simply don't care about and will not need to care about.

I don't even need authorization, all users are the same in the eyes of the application. I just want something that handles the account database, sends e-mails for lost passwords / validating account creation, etc. That's it, really.

Does such a thing exist? Or are my options really to use a "complete" web framework or roll my own from the basic pieces (repoze.who and something like userdb)?
 

Alamout

Ars Legatus Legionis
27,285
How are you hosting it? If you're sticking the Python behind mod_wsgi or cgi, could you just use Apache's basic auth? It's pretty simple, and I don't think it's terribly secure either, but maybe you don't mind that.

If that's not secure enough but you are using Apache, you could set up SSL.

If it's not Apache, I'd still be surprised if whatever server you're using doesn't have something for authentication.
 

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
HTTP Authentication is a horrible user experience I don't wish upon anyone. It also doesn't make creating accounts, validating account creation, and fixing lost passwords any easier. You still have to create and manage the database yourself, send the e-mails yourself, etc. That's the part I'd rather not do (which I realize is a little bit unusual, but it's still code that almost every website needs).
 

Malyk

Ars Tribunus Angusticlavius
8,558
Subscriptor
My guess is that without using something like Django then you'll have to write it all yourself. I have no idea how the add-ons work in the python world, but someone has to have written something for django.

I'd poke around django a bit...there has to be something.

And to troll a little bit... ;)

If you haven't gone too far to switch frameworks/languages Rails + the Devise gem does exactly this and it takes about 10 minutes to set up on a newly created rails app. For a project so small going with rails over django might be worthwhile just for the existing authentication solution and the time saved from not creating a new one.

Mike
 

clm100

Ars Legatus Legionis
13,874
Subscriptor
I doubt they're any good, but CherryPy has some tools that might do it for you. CherryPy really lets you do whatever you want, it's a pretty darn lightweight framework that you can mold into whatever you need it to be. TurboGears might also be flexible enough.

From a few projects I've done, Django is just a beast of a dependency to carry around.
 

dredphul

Ars Tribunus Angusticlavius
6,342
Subscriptor++
Malyk":kzsfh3nb said:
My guess is that without using something like Django then you'll have to write it all yourself. I have no idea how the add-ons work in the python world, but someone has to have written something for django.

I'd poke around django a bit...there has to be something.

First link when googling 'django authentication':
http://docs.djangoproject.com/en/dev/topics/auth/
 
Status
Not open for further replies.