Skip to main content

A Django database backend for integration with TimescaleDB

Project description

A database backend for Timescaledb.

Based on gist from WeRiot.

Still WIP.

Quick start

  1. Install via pip

pip install django-timescaledb
  1. Use as DATABASE engine in settings.py:

    DATABASES = {
    'default': {
        'ENGINE': 'timescale',
        ...
    },
}
  1. Use TimescaleDateTimeField in your models. A hypertable will automatically be created.

from timescale.fields import TimescaleDateTimeField

class SensorLog(models.Model):
   date = TimescaleDateTimeField(interval="1 day")
   value = models.IntegerField()

Custom DB backend

Use a custom PostgreSQL db backend like PostGIS.

# Configure via settings.py

TIMESCALE_DB_BACKEND_BASE = "django.contrib.gis.db.backends.postgis"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-timescaledb-0.2.1.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

django_timescaledb-0.2.1-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page