rutube / django_vertica_backend

8 stars 11 forks source link

Django Vertica Backend

A proof-of-concept for connecting Django ORM to HP Vertica database.

Build Status

Current status

Installation

  1. install vertica_python and django_vertica_backend
  2. edit settings.py

    DATABASES = {
      'default': {
        'ENGINE': 'vertica',
        'NAME': 'dash',
        'HOST': 'localhost',
        'PORT': 5433,
        'USER': 'dbadmin',
        'PASSWORD': 'password'
      }
    }
    

Example

from django.db.models import Sum
from test_app.models import PlatformReport

qs = PlatformReport.objects.filter(date__gte='2014-09-15')
qs = qs.values('platform_id')
qs = qs.annotate(video_views = Sum('video_views'))
print qs[100:500]