Generate HTTP Expires headers

Per Django tuning suggestions in bug 2935, this sets image expirations
to 2 hours, and (versioned) CSS/Javascript to 10 years.
Fix broken template formatting

$()s will not be substituted - only %()s
Improve error message

I am constantly setting PYTHONPATH=`pwd` but it has no effect - it needs
to be exported into the environment, make the error message reflect that.