Skip to content



Repository files navigation

Standard Energy Efficiency Data (SEED) Platform™

The SEED Platform is a web-based application that helps organizations easily manage data on the energy performance of large groups of buildings. Users can combine data from multiple sources, clean and validate it, and share the information with others. The software application provides an easy, flexible, and cost-effective method to improve the quality and availability of data to help demonstrate the economic and environmental benefits of energy efficiency, to implement programs, and to target investment activity.

The SEED application is written in Python/Django, with AngularJS, Bootstrap, and other javascript libraries used for the front-end. The back-end database is required to be PostgreSQL.

The SEED web application provides both a browser-based interface for users to upload and manage their building data, as well as a full set of APIs that app developers can use to access these same data management functions.

Docker quckstart

Install Docker Note, if you are installing on VirtualBox, you will need to setup nat port forwarding for port 8000 VBoxManage controlvm boot2docker-vm natpf1 "8000,tcp,,8000,,8000"

Build the seed platform image

docker build -t seed-platform .

start the redis and postgres services

docker run --name seed-redis -d redis
docker run --name seed-postgres -e POSTGRES_PASSWORD=seed -d postgres

Setup the initial demo user

docker exec -ti seed-postgres createdb -U postgres seed
docker run -v $HOME/seed_data:/seed/collected_static --link seed-redis:redis --link seed-postgres:postgres seed-platform /seed/bin/

Start the Web and Celery services

docker run -d -name seed-uwsgi -v $HOME/seed_data:/seed/collected_static --link seed-redis:redis --link seed-postgres:postgres -p 8000:8000 seed-platform /seed/bin/
docker run -d -name seed-celery -v $HOME/seed_data:/seed/collected_static --link seed-redis:redis --link seed-postgres:postgres seed-platform /seed/bin/

You're done!!

Point your browser at http://localhost:8000 and log in with the account


See Installation Notes for setup on Amazon Web Services or a local server.

Django notes

Both Django and AngurlarJS are used for url routing. Django routes are in SEED/urls/

Amazon AWS S3 Expires headers should be set on the AngularJS partials if using S3 with the management command: set_s3_expires_headers_for_angularjs_partials usage: python set_s3_expires_headers_for_angularjs_partials --verbosity=3

The default user invite reply-to email can be overridden in the BE/settings/ file. The SERVER_EMAIL settings var is the reply-to email sent along with new account emails.

# BE/settings/

AngularJS notes

template tags

Angular and Django both use {{ and }} as variable delimiters, and thus the AngularJS variable delimiters are renamed {$ and $}.

window.BE.apps.seed = angular.module('BE.seed', ['ngRoute', "ngCookies"], function ($interpolateProvider) {

Django CSRF token and AJAX requests

For ease of making angular $http requests, we automatically add the CSRF token to all $http requests as recommended by ($http, $cookies) {
    $http.defaults.headers.common['X-CSRFToken'] = $cookies['csrftoken'];

routes and partials or views

routes in static/seed/js/seed.js (the normal angularjs app.js)

window.BE.apps.seed.config(['$routeProvider', function ($routeProvider) {

            .when('/', {
                templateUrl: static_url + '/seed/partials/home.html'
            .when('/projects', {
                controller: 'project_list_controller',
                templateUrl: static_url + '/seed/partials/projects.html'
            .when('/buildings', {
                templateUrl: static_url + '/seed/partials/buildings.html'
            .when('/admin', {
                controller: 'seed_admin_controller',
                templateUrl: static_url + '/seed/partials/admin.html'
            .otherwise({ redirectTo: '/' });


html partials in static/seed/partials/

on production and staging servers on AWS, or for the partial html templates loaded on S3, or a CDN, the external resource should be added to the white list in static/seed/js/seed/js

// white list for s3
window.BE.apps.seed.config(function( $sceDelegateProvider ) {
    // localhost
    // AWS s3


JS tests can be run with Jasmine at the url app/angular_js_tests/

python test will run the python unit tests, we also use coverage to check the ammount of SLOC covered under tests. The coverage config is in .coveragerc

$ coverage run test
$ coverage report --fail-under=83

flake8 will run the PEP8 compliance tests. Its config is in tox.ini

$ flake8

jshint will run the JS compliance tests. The jshint config is in .jshintrc

$ jshint seed/static/seed/js


The following two commands will run uwsgi and celeryd.


In dev mode, you can start the Django dev server and celery:

./ runserver
./ celeryd -c 4 --loglevel=INFO -E --maxtasksperchild=1000


monitor background tasks flower --port=5555 --broker=redis://localhost:6379/1 assuming your redis broker is running on localhost and on port 6379, DB 1. Then goto localhost:5555 to check celery. If running on AWS, the bin/ will start flower on port 8080 and be available for google credentialed accounts.

dev setup:

  • git clone
  • install Postgres 9.3 and redis for cache and message broker
  • use a virtualenv if desired
  • create a in the BE/settings folder and add CACHE and DB config (example
  • export
  • pip install -r requirements.txt
  • ./ syncdb
  • ./ migrate
  • ./ create_default_user
  • ./ runserver
  • ./ celeryd
  • navaigate to in your browser to add users to organizations
    • each user must belong to an organization!
  • main app runs at

The python create_default_user will setup a default superuser which must be used to access the system the first time. The management command can also create other superusers.

./ create_default_user --organization=be --password=demo123

Logs :

Information about error logging can be found here -

Below is a standard set of error messages from Django.

A logger is configured to have a log level. This log level describes the severity of the messages that the logger will handle. Python defines the following log levels:

DEBUG: Low level system information for debugging purposes
INFO: General system information
WARNING: Information describing a minor problem that has occurred.
ERROR: Information describing a major problem that has occurred.
CRITICAL: Information describing a critical problem that has occurred.

Each message that is written to the logger is a Log Record. The log record is stored in the webserver & Celery


Copyright © 2014 Building Energy Inc.


Standard Energy Efficiency Data Platform







No packages published


  • Python 77.1%
  • JavaScript 12.9%
  • HTML 8.5%
  • CSS 1.3%
  • Other 0.2%