This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File "/home/fred/.virtualenvs/datagoal/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 141, in get_user_model | |
raise ImproperlyConfigured("AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL) | |
django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'user.User' that has not been installed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from __future__ import absolute_import | |
from __future__ import unicode_literals | |
from django.db import models | |
from django.utils.html import format_html | |
from django.contrib.contenttypes.models import ContentType | |
from django.utils.translation import ugettext_lazy as _ | |
from user.models import User |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import | |
# This will make sure the app is always imported when | |
# Django starts so that shared_task will use this app. | |
from .celery import app as celery_app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import | |
import os | |
from celery import Celery | |
# set the default Django settings module for the 'celery' program. | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'datagoal.settings') | |
from django.conf import settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
celery -A datagoal worker -l info | |
Traceback (most recent call last): | |
File "/home/fred/.virtualenvs/datagoal/bin/celery", line 11, in <module> | |
sys.exit(main()) | |
File "/home/fred/.virtualenvs/datagoal/local/lib/python2.7/site-packages/celery/__main__.py", line 30, in main | |
main() | |
File "/home/fred/.virtualenvs/datagoal/local/lib/python2.7/site-packages/celery/bin/celery.py", line 81, in main | |
cmd.execute_from_commandline(argv) | |
File "/home/fred/.virtualenvs/datagoal/local/lib/python2.7/site-packages/celery/bin/celery.py", line 769, in execute_from_commandline | |
super(CeleryCommand, self).execute_from_commandline(argv))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$promise: undefined | |
$resolved: true | |
class_name: "Value" | |
datadoc: Object | |
22: "29/07/2015" | |
__proto__: Object | |
harvest: 167 | |
id: 1293 | |
question: 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data.forEach(function (harvest) { | |
var values = harvest.values, | |
h = new Harvest(); | |
h.id = harvest.id; | |
h.uuid = harvest.uuid; | |
h.device = harvest.device; | |
h.date = harvest.created; | |
h.values = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for q in data['values']: | |
q['question'] = Question.objects.get(id=q['question']) | |
q['harvest'] = harvest | |
hv, created = Value.objects.update_or_create(harvest=q['harvest'], | |
question_id=q['question'].pk) | |
hv.harvest = q['harvest'] | |
hv.question = q['question'] | |
# print(q['datadoc']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
# from django.shortcuts import render | |
from django.http import HttpResponse | |
from django.views.decorators.csrf import csrf_exempt | |
from django.core.mail import send_mail, BadHeaderError | |
@csrf_exempt | |
def contact_me(request): | |
name = request.POST.get('name', '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('myApp', ['ngGrid', 'ngResource']); | |
app.config(['$httpProvider', function ($httpProvider) { | |
$httpProvider.defaults.xsrfCookieName = 'csrftoken'; | |
$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken'; | |
}]); |