Bryan Pieper's Blog : Django

Looking for a bolt on DJango app to compress/minify your JavaScript and CSS files? I created the staticcomp Django app for just that purpose.

Benefits:

  • Ability to compress/minify JS/CSS files on-demand
  • Increase website performance by reducing the total number of JS/CSS file requests
  • Build modular JS/CSS files by page / section instead of relying on large files
  • No need to use date-based file names or query string values to force the browser to download changes to your JS/CSS files
  • Improved Google Page Speed score and SEO benefits from a faster overall website
  • Integrated with UglifyJS, the same JavaScript compressor used by jQuery
  • Allows you to create your own backends or use one of the four existing

memcachedThePiepers.net serves the compressed JS and CSS files using the nginx memcached module. The python backend compresses the content and stores the content in memcached to be served via nginx.

This weekend, I upgraded to Django 1.3. After some testing, the JS and CSS files were bypassing memcached and being served by python. As you can imagine, this is not the most efficient method to serve static content.

Looking for a way to track your 404 pages using Google Analytics? Modify the ‘_trackPageview’ function call.

By default, Google Analytics doesn’t have a way to classify the 404 pages. Before you begin, you’ll need to be able to detect a 404 page on the server side. If you cannot determine the response status, this will not work for you.

html5I recently went through the fairly painless of process of upgrading thepiepers.net to html5. This will allow me more flexibility in the future as more browsers expand their support for html5. In addition, html5 has a number of improvements over html4 that will make my front-end work a little easier.

In the process of upgrading the site, I implemented the following

  1. Internet Explorer overrides for html5 elements
  2. Fixed display issues for non-html5 elements
  3. Implemented Django html5 form inputs
1 2 3