Nov. 24th, 2009

elfs: (Default)

So, I got tired of the way Django-SocialAuth was borked and not working for me, so I forked the project and have put up my own copy at GitHub.

There are three things I noticed about the project right away: First, it forces you to use a broken templating scheme. I haven’t fixed that, but in the meantime I’ve ripped out all of the base.html calls to keep them from conflicting with those of other applications you may have installed. Really, the templates involved have very little meat on them, especially for the login.html page. These are components that would have been better written as templatetags. Second, the project is rife with spelling errors. (The most famous, of course, being that the original checkout was misspelled “Djano”). I am a fan of the notion that a project with spelling problems probably has other problems. I’ll make allowances for someone for whom English is a second language, but I was not filled with confidence. And third, the project violates Facebook’s TOS by storing the user’s first and last name. Along the way I discovered that the Facebook layer was completely non-functional if you, like three million other Facebook users, had clicked “Keep me logged in,” which zeros out the “login expires” field from Facebook. It would never accept you because your expiration date would then always be January 1, 1970, effectively before “now.”

I’ve barely begun hacking on the beast, but already I’ve made some progress. Facebook now works the first time around. I’ve cleaned up much of the spelling and grammar in the documentation, such as it is, and I’ve clipped many of the template naming problems that I saw in my original use of the system. I’ve also revised setup.py so that it runs out of the box, although I’m tempted to go with a different plan, one like django-registration where it is your responsibility to cook up the templates for the provided views. And I’ve ripped out most of the Facebook specific stuff to replace it with calls to PyFacebook, which is now a dependency.

One thing I do want to get to is a middleware layer that interposes the right social authentication layer on those users who come in from the outside world: i.e. if the AuthMeta indicates you’re a facebook user, then request.user will be a lightweight proxy between you and Facebook for those fields that are, by definition, Facebook-only (and a violation of the TOS if you copy them). It might make more sense to have a decorator class, but only if you don’t have a gazillion views.

I haven’t gotten much further than a Facebook layer that satisfies my immediate needs. I haven’t had a need to branch out and explore the Twitter or Oauth components yet. What I needed at the moment was a simple authentication layer that allowed either local users (for testing purposes) or FacebookConnect users, and one that didn’t need to contact Facebook for absolutely every view, whether you wanted it or not, just to check “is this guy still a facebook user?”, which is how the DjangoFacebookConnect toolkit does things. I suppose, if you’re a Facebook app, that’s what you want, but I’m not writing a Facebook app, I’m writing an app that uses FacebookConnect to associate and authenticate my application users’s accounts via their Facebook accounts.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

Yes, that’s a signal boost.

I’ve only played with Node.js for about 24 hours now, and I’m already deeply impressed with it. Node.js is something of a holy grail: an implementation of server-side (and desktop) Javascript with a modern engine (Google’s V8), in which all I/O is event-handled. You no longer care about multiplexing, spinning off threads, or any of the myriad gazillion other cares that server developers used to worry about. Instead, that’s been built into a reactor core inside Node.js, and instead you receive notice of events (just like in browser-based Javascript), where the events will things like “header received,” “body received,” “message end,” “connection made,” and to which you’ll be able to attach enclosured functions that will respond appropriately. It’s an application server’s base language on acid, and while I’m bad at making predictions, I suspect Node.js will be with us for a while.

Already there’s a NoSQL database interface, the start of an application server, the start of a CLib-like library (like Python or Perl’s standard library), and even a comet server. This could be fun.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com

Keepers...

Nov. 24th, 2009 11:43 pm
elfs: (Default)
A long time ago, writer [livejournal.com profile] jaylake held what he called "The Canticle for Lebowski Mash-Up contest." The idea was to mash together two titles and create a new story. This evening, for some reason, I was utterly plagued with the notion that I couldn't remember what my contributions were. So I went and dug them up, and am archiving them for future reference:

I Am Curious Legend

A bizarre art-film, shot in black-and-white with some hand-tinted frames, this film stars a young, beautiful and shirtless Tom Cruise holed up in a house while vampires wander about. His nemesis is a tall and almost unrecognizably buff Tim Curry, but Tom and his girlfriend stay inside arguing about unicorns, obesity, and free love.

Kushiel's Scion Tc

An advertising campaign for cheap automobiles goes horribly wrong and brings an unfortunate young man to the attention of gods with a taste for pain. A trilogy with the follow-on titles Kushiel's Subaru Legacy and Kushiel's Dodge Dart, is planned.

The Wind-Up Bird Chronicles of Thomas Convenant

Appropriate to both writers, it has little to no plot. The author announced a sequel, Hardboiled Wonderland and the End of the World as We Know It, And I Feel Fine, but the book never materialized.

The Blair Witches Of Eastwick

The Canadian Who Came Almost All the Way Home From The Stars My Destination

*Blink* I almost think that story would work.

Profile

elfs: (Default)
Elf Sternberg

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 29th, 2025 12:31 am
Powered by Dreamwidth Studios