spacer Sign in with spacer OpenID

Simon Willison’s Weblog

On javascript, scaling, python, microsoft, oxfordgeeknight2, ...

 

Recent entriesspacer -->

Turn your Django application in to an OpenID consumer 13 days ago

I’ve just put the finishing touches on the first releasable version of django_openidconsumer, a package that makes it easy to add OpenID consumer support to any Django application.

Full documentation can be found in the repository. The package consists of Django models that implement the persistent part of an OpenID consumer, some simple views that hook in to the python-openid library from OpenID Enabled and a piece of middleware that makes the user’s OpenID(s) directly available within a Django view.

To cut a long story short, it allows you write view functions that look like this:


def example_view(request):
    if request.openid:
        return HttpResponse("OpenID is %s" % escape(
            str(request.openid)
        ))
    else:
        return HttpResponse("No OpenID")

The package also supports simple registration, which lets you request additional details such as an e-mail address or nickname from the user’s OpenID provider.

I plan to keep the package under active development, with the aim of using it to demonstrate best practises in implementing OpenID (hence the support for multiple OpenIDs and simple registration out of the box). Next on the list is integration with Django’s built in authentication system, including the ability to associate one or more OpenIDs with an existing user account.

Please post any feedback as a comment on this entry, and direct bug reports to Google Code.

1:41 am / 24th April 2007 / spacer / django, djangoopenid, openid, python

Extending a WiFi network with two Macs and a FireWire cable 25 days ago

Last night’s Oxford Geek Night went really well, despite more than the usual flurry of problems. It’s definitely true that the more geeks there are in a room the less likely it is that the projector will work! Thankfully we got everything up and running in time for the talks to start, although it was a pretty close call.

A few of the talks needed internet access from the stage—always risky at conferences, which is why I’ve taken to recording screencasts of anything I want to demonstrate just in case there’s a problem. For the last event we hooked up a mobile phone to a laptop running an ad-hoc WiFi network, which was slow but worked fine. This time round we checked with the venue well in advance to confirm that their WiFi had been installed.

The wireless was indeed up and running, but there was one pretty significant problem: the stage was just out of range! We could pick up a network signal fine from about 10 feet away from the stage, but the layout of the building meant that the stage itself was a WiFi blackspot.

At that point the evening started feeling a bit like Apollo 13. We had a bunch of laptops, various cables (but sadly no 10 foot network cable; that’s on the list for next time) and about half an hour to go before the event kicked off. That’s when I remembered that Internet Connection Sharing under OS X has a “FireWire” option.

So here’s how to build your own WiFi repeater using two Macs and a FireWire cable:

  1. Connect Mac A to the existing WiFi network. Confirm with ping or a browser.
  2. Turn off the AirPort card on Mac B (for the moment).
  3. Run a FireWire cable between A and B.
  4. On Mac A, bring up System Preferences -> Sharing -> Internet.
  5. Share your connection from “AirPort” to “Built-in FireWire”.
  6. On Mac B, find System Preferences -> Network -> Built-in FireWire, and check that you’ve successfully connected.
  7. Confirm that Mac B can see the internet, using ping or a browser.
  8. On Mac B, browse to System Preferences -> Sharing -> Internet.
  9. Share your connection from “Built-in FireWire” to “AirPort”.
  10. Click “AirPort Options...” and set a name for the new network (and optional WEP key). This is the network that other machines will connect to.
  11. Hit “Start”.

All we had to do then was position our pair of laptops somewhere that was in WiFi range of both the venue network and the stage. Job done!

Except for one thing... we forgot to factor in the dampening factor of human bodies. As the area filled up the signal strength from the venue WiFi reduced, leading to intermittent network failures. The nice thing about laptops is that you can move them around, so for the talks that needed network access Nick and I stood near the door with our laptops held over our heads.

It’s a good thing the venue microphone showed up at the last minute, as our backup plan for that involved two laptops, a USB microphone, a patch in to the mixing desk and iChat AV...

We’ve started adding slides to the official site, and will hopefully soon have videos up there as well. If you took any photos at the event tag them on Flickr with oxfordgeeknight2 to have them show up on the site. Nat’s planning the next event for June or July, so subscribe to the announce-only mailing list if you want to stay informed.

1:59 pm / 12th April 2007 / spacer / events, osx, oxfordgeeknight2, oxfordgeeknights, torchbox, wifi

Oxford Geek Night 2 one month ago

If you missed the last Oxford Geek Night, you really owe it to yourself to make it to the next one. If you were there then you shouldn’t need any convincing.

Oxford Geek Night 2 will be on the 11th of April, starting at 7.30pm (talks start at 8.30) upstairs at the Jericho Tavern. Nat has just announced the two keynotes: Jon Hicks will be talking about typography on the Web and his thoughts on typographic trends for 2007, and James Webster from Amazon UK will be presenting Amazon’s web service suite.

In addition to the two 15 minute keynotes there will also be eight 5 minute microslots. Nat is currently taking proposals for these; this is a good chance to give a lightning demo of something you’ve worked on and a great opportunity for first time speakers to gain valuable experience in front of a friendly audience.

The event is sponsored by Torchbox. Entry is free to all, but you should sign up on Upcoming to give us an idea of numbers.

7:21 pm / 28th March 2007 / spacer / amazon, jameswebster, jonhicks, nataliedowne, oxford, oxfordgeeknights, torchbox, typography

Elsewherespacer -->

Today

spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer

Yesterday

spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer spacer

  • CSS2.2. Andy Budd points out that CSS hasn’t had an update since 1998, and suggests rolling the most obviously useful parts of CSS 3 in to an incremental CSS 2.2. spacer

5th May 2007

  • The One True Object (Part 2). Jim Hugunin describes how the DLR let’s Python / JavaScript / Ruby talk to each other using a message passing abstraction. spacer

4th May 2007

  • Microsoft's XUL. My take on XAML from back in 2003 seems strangely relevant. spacer
  • Inline SVG in MSIE. Sam Ruby has a neat proof of concept that converts inline SVG (currently only the path element) to the Silverlight equivalent. spacer
  • Migrating Microsoft Hotmail from FreeBSD to Microsoft Windows 2000. I’d like to see them try that with Yahoo!’s 100+ properties. spacer
  • MSFT and Yahoo: two icebergs, roped together�. Yahoo!’s engineering platform and culture is Open Source pretty much all the way down. Microsoft’s isn’t. I wonder how that would pan out. spacer

3rd May 2007

  • Crabfu SteamWorks. More awesome steam-powered robots. spacer
  • Actual Steampunk Star Wars! I-Wei Huang made a steam-powered R2-D2. spacer
  • ... Facebook has roughly 200 dedicated memcached servers in its production environment, plus a small number of others for development and so on. A few of those 200 are hot spares. They are all 16GB 4-core AMD64 boxes, just because that’s where the price/performance sweet spot is for us right now.

    — Steve Grimm spacer

  • Dynamic Language Runtime. Miguel de Icaza describes how Microsoft’s new Dynamic Language Runtime lets you call JavaScript and Visual Basic functions from Ruby. Looks like they beat Parrot to the punch. spacer
  • Introduction and Yahoo! Pipes. The official Google Maps API blog describes how to plot KML output from Yahoo! Pipes. spacer
spacer
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.