For web application, it's useful to be able to generate different types of random strings. Default passwords, CAPTCHAs, and API keys are just some examples of website random strings.
I finally revamped my string generating utility when I wanted to generate a human-readable string. I'd like each Pownce user to have a "syndication key" for several potential new features including custom feeds (non-public), upcoming event feeds, and email posting. It's helpful to have a readable key for email posting since nobody wants to remember something like "cp59p18sv3wwi4z0". Blech. That's just fine for API keys though.
Flickr does a nice readable key with actual short words (5-6 characters) for their email posting. I didn't really want to use a dictionary of available words and thought that the form used in this example was probably good enough. It generates something like "fof91yoj".
The only thing you'll need to change is where you're getting the lists, BANNED_WORDS and BANNED_PHRASES. Pownce is becoming a total rat's nest and I'm too lazy to mess with these for the example.
Is there a library (Python or Django) to do this already? I didn't search too hard because I really wanted to an excuse to write code that uses lambda.