Index ¦ Archives ¦ Atom

Speed up Django static files

For a fairly easy performance win, and for something which makes dealing with old cached CSS something a thing of the past - enable ManifestStaticFilesStorage.

First of all you'll need to edit settings.py:

# Use manifest static storage
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'

Then you'll need to edit ...


Be careful with Django's .create_or_update()!

Although using Model.objects.create_or_update() with a Django model is extremely convenient, sometimes you might want to consider using it carefully with certain usage patterns.

Excessive Postgres WAL files

To allow point-in-time recovery (PITR), I usually setup Barman. Set it up on a remote server, get your Postgres instance to ...


Improving a Pelican blog with gulp

Pelican is a Python powered static site generator, which is useful for blogs or other small static sites. Although a respectable number of Pelican plugins are available - the Node.js/JavaScript ecosystem for build systems is currently much stronger and updated far more frequently.

In this example I'm going ...


MySQL UNIX socket authentication

It's not currently a default feature, but since MySQL 5.5.10 you can easily enable UNIX socket authentication.

Add the following to your MySQL config file:

[mysqld]
plugin-load=auth_socket=auth_socket.so

Restart MySQL, then you'll be able to use IDENTIFIED WITH auth_socket as a replacement for IDENTIFIED ...


DigitalOcean Debian kernel

DigitalOcean offers some fantastic KVM powered virtual machines for low prices, however the technical decisions they've made in various places leaves something to be desired.

One of the problems which you may face at some point is that you're stuck with whatever kernel they provide, you can't ...

© Alex Tomkins.