Index ¦ Archives ¦ Atom

Easier PostgreSQL Extension Installations

Postgres has a number of extensions which require superuser access for a user to install them, PostGIS being one of them. If you're wanting to install a GeoDjango app, you'll probably encounter an error such as:

$ ./manage.py migrate
Traceback (most recent call last):
  ..
django.db.utils.ProgrammingError: permission denied …

Testing cloud-init with Vagrant

cloud-init is a standard tool in most cloud computing environments as it's an easy way to provide configuration for provisioning server instances. You provide a YAML config file and it'll use the data to configure the server as needed.

Testing cloud-init in a public can be a bit problematic and …


Automating Ansible groups with Vagrant

Vagrant is a great tool for creating development environments and testing deployment scripts, especially with Ansible. Testing an Ansible playbook is can be as simple as vagrant up.

The problem

Ansible uses an inventory file to define the SSH details for each server, what groups a server belongs to - which …


Upgrading packages in all Python virtual environments

If you're working with a lot of Python virtual environments in a wide variety of projects, over time you'll end up with outdated packages in some of the older ones - potentially missing out on new features.

For most of the packages you'll want to keep them at a specific version …


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 any templates …

© Alex Tomkins.