Darren O'Neill

Connecting to a Vagrant database using 0xDBE

0xDBE is a new SQL editor from Jetbrains that is currently available as an Early Access Program (EAP). As a user of PyCharm I thought I would check it out.

It seems a solid program but it can be a bit fiddly getting connected to a database in a Vagrant ...

Introducing django-datetime-utc

Today I submitted a package to PyPi called django-datetime-utc. You can install it via Pip:

$ pip install django-datetime-utc

This package provides DateTimeUTCField, a naive datetime model field. In PostgreSQL this translates to the field timestamp without time zone. All timestamps are saved in UTC.

I created this because ...

Real time web apps with PostgreSQL and Node.js

This post shows you how to set up PostgreSQL so it triggers a notify event along with additional information to a listening Node.js script. The script will broadcast this information over a WebSocket to the user's browser, all in real time.

PostgreSQL

PostgreSQL allows you to listen for ...

Timestamps and databases

I have found the most reliable way to store times with different time zones is to not actually use a time zone aware type your database may provide. For example PostgreSQL provides timestamp with time zone. The best way is to store everything in UTC time in a naive timestamp ...

Using PostGIS and GeoDjango to find your nearest neighbour

Firstly create a database table to hold points of interest. You should probably use South / Django's syncdb. SQL shown for reference:

CREATE TABLE store (
    id integer NOT NULL,
    name character varying(100),
    location geography(Point,4326),
    longitude double precision,
    latitude double precision
);

CREATE INDEX store_location_idx ON store USING gist ...