Mar 8 2010

Code-sharing Update

When we decided to move SUMO to a new platform, one of the reasons we chose Django was code sharing and reuse—specifically that SUMO and AMO would be able to share code, meaning both teams would save time and see benefits.

So how is that going? Were we right in our assumption here? The code we’re sharing so far:

MultiDB Router
A Django DB router that supports reading from a pool of slave databases.
Cache Machine
A powerful caching library for Django that, in particular, provides automatic object caching and invalidation through the ORM.
Jingo
An adapter for using Jinja2 templates with Django.
Django-Nose
A test runner for Django using Nose.
Django Debug Cache Panel
Adds a cache panel for Django Debug Toolbar.
Test-Utils
Tools we use testing in the Django/Jinja2/Nose setup.
Bleach
A library for sanitizing and linkifying user HTML, based on html5lib.
Fixture Magic
Django management commands for working with fixture data.

Additionally, we expect both teams will probably use the following, eventually:

DidYouMean
A wrapper for Hunspell, using PyHunspell to provide spelling suggestions for searches.
Django Gearman
Provides an easier interface from Django to the Python Gearman bindings.
AMO’s JS and CSS minification
AMO has already solved the problem of JS and CSS minification with Django and Jinja2.

And it’s not a released library, but SUMO has also been able to directly reuse code from AMO to simplify pagination.

Overall, it seems like we’re doing really well on this! It’s great to see the projects not just sharing code, but packaging and publishing it on Github and PyPI. If any of the above is useful to you, go ahead and try it out! You can open issues with any of the packages on Github, or find us in #webdev in irc.mozilla.org.


Feb 25 2010

Bleach, HTML sanitizer and auto-linker

Bleach is a whitelist-based HTML sanitizer and auto-linker in Python, built on html5lib, for AMO and SUMO and released under the BSD license.

Bleach has two main functions: sanitizing HTML based on a whitelist of tags and attributes, and turning URLs into links. It uses html5lib for both.

For more information on using Bleach, see the README included in the source. For more info on how Bleach works, follow below the jump. Continue reading


Feb 23 2010

The Evolution of SUMO

When I joined the SUMO team six months ago, the team was just starting a discussion of “where do we go from here?”  SUMO was built on a CMS called TikiWiki, and had diverged pretty significantly in two years. (David Tenser wrote a more detailed history if you’re interested.)

After a few months of talking and testing—and a few changes of direction—we’ve decided that SUMO will follow our colleagues on AMO and move to a custom web application, built on Django, a development framework in Python.

Why are we committing to such a dramatic new direction? Three major reasons. Continue reading


Dec 8 2009

Local Web Development

I’m not ashamed of it: I like Windows. I think the user experience is light-years ahead of Gnome and KDE. There’s nothing ostensibly wrong with OS X, but there are little usability differences and frankly switching isn’t worth the annoyance to me. That’s why I run Windows 7 on all three computers I use daily.

This is only a problem when I try to work on LAMP web applications. Sure, I could install XAMPP, but running Apache/PHP on Windows is really not close enough to a production environment. So I have two choices: I can dual-boot Linux and work in an OS—well, a window manager—I don’t like, or I can turn to virtual machines. Continue reading


Dec 3 2009

So You Wanna Help Mozilla?

A common theme we heard in responses to our web developer survey was: “I wish I could help Mozilla, but I’m just a web developer.”

Well, fellow web ninjas, you can put your skills to work with Mozilla and help make the web a better place. Our web projects are open, just like Firefox, and we’d love your help!

If you’re a web developer and want to help Mozilla and Firefox users while working on sites that see millions of visitors every day, follow me through the jump and I’ll show you around our shop and introduce you to the tools we use. Continue reading


Sep 28 2009

Mozilla Web Development is Open Source

At Mozilla, our web development projects are open source, publicly available, and interested in community contributions.

This is one of those things that makes absolute sense when you hear it, but you may have never heard, or thought, of it before.

It’s not terribly well-publicized—that’s something Mike Morgan and I are going to start working on this week—but there are ways you can get involved:

Why would you want to contribute to Mozilla web development projects?

Hopefully I’ll have something to add by the end of the week, but in the meantime, come on over and say “hi” on IRC!