Postgis

Mon 19 August 2013
from cities.models import City
cape_town = City.objects.filter(country__name='South Africa').get(name='Cape Town')
nearest = City.objects.distance(cape_town.location).exclude(id=cape_town.id).order_by('distance')[:10000]

I must be very damaged from location data being badly implemented in MySQL. I'm still amazed that this request could be …

Category: Django Tagged: geolocation python django postgres

comments

Read More

Diary.py future proof memories.

Thu 08 March 2012

I've created a little command line diary script for anyone whose interested. It stores your diaries in separate txt files so you know all of your memories will always be accessible to you in a format you'll always be able to read. It's super quick and easy to use. It's …

Category: Projects Tagged: diary python

comments

Read More

Quick vhost script

Thu 01 March 2012

Quick script to setup a new virtualhost entry for apache. Works for me on archlinux.

#!/usr/bin/python
import sys, os, subprocess

vhosts_file = "/etc/httpd/conf/extra/httpd-vhosts.conf"
hosts_file = "/etc/hosts"

domain_name=sys.argv[1]
folder=sys.argv[2]

def usage():
print("Usage: add_vhost url_to_add /folder/to/point/to …

Category: Projects Tagged: apache python

comments

Read More
Page 2 of 2

« Prev