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 ...

Sending triggered emails with Django using Celery and SES

This post shows how you can send triggered emails asynchronously through Amazon's SES (Simple Email Service) using Django, Celery and RabbitMQ.

First up install and run RabbitMQ:

  • Install: sudo apt-get install rabbitmq-server
  • Run: rabbitmq-server

Next install Celery following the instructions here (make sure you add the following to settings ...

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 ...

Integrate Bugsnag into ZF2

In Zend Framework 2 you approach exception handling quite differently from how you currently do in version 1 of the framework. Gone are error controllers and in are event listeners.

If you like to use an an external service to notify you of raised exceptions you will need to rework ...

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 ...