Author archives: Mike

RSS feed of Mike

Do I really need 0-copy?

Nginx Upload Module's key feature/optimization is that as nginx streams the multipart post to disk, it directs the embedded files directly to separate file handles, you can then just move those files to the final location.  So far everything I've seen to replace it has at least a couple of copies going on, as they ...

Continue reading

Generic Filter/Sort Tables for Django?

So this came up (again). Users want to be able to look at a (largish) set of records in Django (millions of records) and do the following:

  • click columns to sort by field values (with indication of sort direction, of course)
  • filter by column values (include, exclude, greater-equal, less-equal); that is, they want to click ...

Continue reading

Compress your JS/CSS in Django

Finally integrated webassets (django_assets) into our build process. Very nice interface (using the template-only approach). And other than a few issues with our pyc-only deployments, it pretty much "just worked" once I realized that adding the staticfile-finder for the development server is a critical requirement.

The changes to your settings look like this:

# use ...

Continue reading

Lazy Caching Proxy Results in Nginx

If you are using nginx as your front-end server for Django, you can also use it as a proxy cache (for smaller websites). You configure the cache like so:

proxy_cache_key "$scheme://$host$request_uri";
proxy_cache_path  /var/blog/cache  levels=1:2  keys_zone=blogcache:120m;
proxy_temp_path   /var/blog/proxy;
proxy_cache_valid 200 302  5m;
proxy_cache_valid 404      1m;
proxy_cache_use_stale updating;
proxy_cache_bypass $cookie_sessionid;
proxy_no_cache $cookie_sessionid;

The proxy_no_cache and proxy_cache_bypass lines ...

Continue reading

Blog Rebooted

I've moved the blog onto its own VPS, running Zinnia (a Django based blog platform). It's using the Zinnia Bootstrap theme, and hopefully most of the old content will have ported over properly. The server has a (free) SSL certificate, so you can, should you wish, browse or comment using SSL (I really can't imagine ...

Continue reading

Playing with EGL platform for PyOpenGL

Played around a bit today with generating an EGL wrapper (for mesa-egl).  No real reason for it, other than I wanted to see what EGL is like.  One thing that shows up is that the current idea of a "platform" in PyOpenGL is a little too limited. EGL is cross-platform, and apparently can work with ...

Continue reading

QIII Shader File Parser added to Twitch

So after yesterday's post, you *must* have been thinking: "where *are* all those textures"? No one has 30 missing textures in a map level. A few of them seem like something that might have been hard-coded, "noshader" "clip" and the like, but there's no way those "sky" textures were going to be hard-coded to content ...

Continue reading

Added Textures to Twitch this evening...

I've been playing at writing a small Quake III BSP map rendering engine using PyOpenGL (and OpenGLContext, for now) when I get the bug to do 3D.

Today I added basic texture rendering for "simple" surfaces (non bezier spline patches). With that you can wander around (unzipped) maps and tell what's going on, but nothing ...

Continue reading

Video from PyCon.ca is up...


The video has a number of drop-outs, and as noted elsewhere, it turns out that the section on Python 3 was wrong. Sigh. Python 3 did not clean up the profile/cProfile duality as it did for all other name/cName pairs, so Python 3 profiling works as long as you use Python 2 tools to process ...

Continue reading