Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-analytics-data-api
Commits
5df51bd3
Commit
5df51bd3
authored
Sep 03, 2014
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgraded to Django 1.7
parent
1a0cd5bb
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
12 deletions
+17
-12
.pylintrc
+4
-1
Makefile
+4
-4
README.md
+2
-2
analytics_data_api/management/commands/set_api_key.py
+5
-1
analytics_data_api/v0/models.py
+1
-1
analyticsdataserver/settings/base.py
+0
-1
requirements/base.txt
+1
-2
No files found.
.pylintrc
View file @
5df51bd3
...
@@ -62,7 +62,10 @@ disable=
...
@@ -62,7 +62,10 @@ disable=
# E1103: maybe no member
# E1103: maybe no member
E1103,
E1103,
# C0111: missing docstring (handled by pep257)
# C0111: missing docstring (handled by pep257)
C0111
C0111,
# We can decide if names are invalid on our own
invalid-name,
[REPORTS]
[REPORTS]
...
...
Makefile
View file @
5df51bd3
...
@@ -4,7 +4,7 @@ COVERAGE = $(ROOT)/build/coverage
...
@@ -4,7 +4,7 @@ COVERAGE = $(ROOT)/build/coverage
PACKAGES
=
analyticsdataserver analytics_data_api
PACKAGES
=
analyticsdataserver analytics_data_api
DATABASES
=
default analytics
DATABASES
=
default analytics
.PHONY
:
requirements develop clean diff.report view.diff.report quality
syncdb
.PHONY
:
requirements develop clean diff.report view.diff.report quality
migrate
requirements
:
requirements
:
pip install
-q
-r
requirements/base.txt
pip install
-q
-r
requirements/base.txt
...
@@ -46,10 +46,10 @@ quality:
...
@@ -46,10 +46,10 @@ quality:
validate
:
test.requirements test quality
validate
:
test.requirements test quality
syncdb
:
migrate
:
$
(
foreach db_name,
$(DATABASES)
,./manage.py
syncdb
--
migrate
--noinput
--database
=
$(db_name)
;
)
$
(
foreach db_name,
$(DATABASES)
,./manage.py migrate
--noinput
--database
=
$(db_name)
;
)
loaddata
:
syncdb
loaddata
:
migrate
python manage.py loaddata education_levels problem_response_answer_distribution
--database
=
analytics
python manage.py loaddata education_levels problem_response_answer_distribution
--database
=
analytics
python manage.py generate_fake_course_data
python manage.py generate_fake_course_data
...
...
README.md
View file @
5df51bd3
...
@@ -19,8 +19,8 @@ Getting Started
...
@@ -19,8 +19,8 @@ Getting Started
2.
Setup the databases:
2.
Setup the databases:
$ ./manage.py
syncdb --
migrate --noinput
$ ./manage.py migrate --noinput
$ ./manage.py
syncdb --
migrate --noinput --database=analytics
$ ./manage.py migrate --noinput --database=analytics
3.
Create a user and authentication token. Note that the user will be created if one does not exist.
3.
Create a user and authentication token. Note that the user will be created if one does not exist.
...
...
analytics_data_api/management/commands/set_api_key.py
View file @
5df51bd3
...
@@ -2,12 +2,15 @@
...
@@ -2,12 +2,15 @@
from
optparse
import
make_option
from
optparse
import
make_option
from
django.contrib.auth
.models
import
User
from
django.contrib.auth
import
get_user_model
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.core.management.base
import
BaseCommand
,
CommandError
from
analytics_data_api.utils
import
delete_user_auth_token
,
set_user_auth_token
from
analytics_data_api.utils
import
delete_user_auth_token
,
set_user_auth_token
User
=
get_user_model
()
class
Command
(
BaseCommand
):
class
Command
(
BaseCommand
):
"""A command to set the API key for a user using when using TokenAuthentication."""
"""A command to set the API key for a user using when using TokenAuthentication."""
...
@@ -30,6 +33,7 @@ class Command(BaseCommand):
...
@@ -30,6 +33,7 @@ class Command(BaseCommand):
if
len
(
args
)
<
2
:
if
len
(
args
)
<
2
:
raise
CommandError
(
"You must supply both a username and key."
)
raise
CommandError
(
"You must supply both a username and key."
)
# pylint: disable=no-member
user
,
_
=
User
.
objects
.
get_or_create
(
username
=
username
)
user
,
_
=
User
.
objects
.
get_or_create
(
username
=
username
)
try
:
try
:
...
...
analytics_data_api/v0/models.py
View file @
5df51bd3
...
@@ -89,7 +89,7 @@ class ProblemResponseAnswerDistribution(models.Model):
...
@@ -89,7 +89,7 @@ class ProblemResponseAnswerDistribution(models.Model):
course_id
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
,
db_column
=
'course_id'
)
course_id
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
,
db_column
=
'course_id'
)
module_id
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
,
db_column
=
'module_id'
)
module_id
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
,
db_column
=
'module_id'
)
part_id
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
,
db_column
=
'part_id'
)
part_id
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
,
db_column
=
'part_id'
)
correct
=
models
.
BooleanField
(
db_column
=
'correct'
)
correct
=
models
.
Null
BooleanField
(
db_column
=
'correct'
)
count
=
models
.
IntegerField
(
db_column
=
'count'
)
count
=
models
.
IntegerField
(
db_column
=
'count'
)
value_id
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
,
db_column
=
'value_id'
,
null
=
True
)
value_id
=
models
.
CharField
(
db_index
=
True
,
max_length
=
255
,
db_column
=
'value_id'
,
null
=
True
)
answer_value_text
=
models
.
TextField
(
db_column
=
'answer_value_text'
,
null
=
True
)
answer_value_text
=
models
.
TextField
(
db_column
=
'answer_value_text'
,
null
=
True
)
...
...
analyticsdataserver/settings/base.py
View file @
5df51bd3
...
@@ -181,7 +181,6 @@ DJANGO_APPS = (
...
@@ -181,7 +181,6 @@ DJANGO_APPS = (
)
)
THIRD_PARTY_APPS
=
(
THIRD_PARTY_APPS
=
(
'south'
,
'rest_framework'
,
'rest_framework'
,
'rest_framework.authtoken'
,
'rest_framework.authtoken'
,
'rest_framework_swagger'
,
'rest_framework_swagger'
,
...
...
requirements/base.txt
View file @
5df51bd3
Django==1.
6.6
# BSD License
Django==1.
7
# BSD License
Markdown==2.4.1 # BSD
Markdown==2.4.1 # BSD
South==1.0 # Apache License
django-model-utils==1.4.0 # BSD
django-model-utils==1.4.0 # BSD
djangorestframework==2.3.5 # BSD
djangorestframework==2.3.5 # BSD
ipython==2.1.0 # BSD
ipython==2.1.0 # BSD
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment