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
8f9245c3
Commit
8f9245c3
authored
Sep 03, 2014
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #23 from edx/django-upgrade
Upgraded to Django 1.7
parents
25ef8334
5df51bd3
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
60 deletions
+18
-60
.pylintrc
+4
-1
Makefile
+5
-5
README.md
+2
-2
analytics_data_api/fixtures/single_course_activity.json
+0
-47
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 @
8f9245c3
...
@@ -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 @
8f9245c3
...
@@ -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,11 +46,11 @@ quality:
...
@@ -46,11 +46,11 @@ 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
single_course_activity
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
demo
:
clean requirements loaddata
demo
:
clean requirements loaddata
...
...
README.md
View file @
8f9245c3
...
@@ -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/fixtures/single_course_activity.json
deleted
100644 → 0
View file @
25ef8334
[
{
"pk"
:
40
,
"model"
:
"v0.CourseActivityByWeek"
,
"fields"
:
{
"course_id"
:
"edX/DemoX/Demo_Course"
,
"interval_start"
:
"2014-05-24T00:00:00Z"
,
"activity_type"
:
"posted_forum"
,
"count"
:
100
,
"interval_end"
:
"2014-06-01T00:00:00Z"
}
},
{
"pk"
:
106
,
"model"
:
"v0.CourseActivityByWeek"
,
"fields"
:
{
"course_id"
:
"edX/DemoX/Demo_Course"
,
"interval_start"
:
"2014-05-24T00:00:00Z"
,
"activity_type"
:
"attempted_problem"
,
"count"
:
200
,
"interval_end"
:
"2014-06-01T00:00:00Z"
}
},
{
"pk"
:
201
,
"model"
:
"v0.CourseActivityByWeek"
,
"fields"
:
{
"course_id"
:
"edX/DemoX/Demo_Course"
,
"interval_start"
:
"2014-05-24T00:00:00Z"
,
"activity_type"
:
"any"
,
"count"
:
300
,
"interval_end"
:
"2014-06-01T00:00:00Z"
}
},
{
"pk"
:
725
,
"model"
:
"v0.CourseActivityByWeek"
,
"fields"
:
{
"course_id"
:
"edX/DemoX/Demo_Course"
,
"interval_start"
:
"2014-05-24T00:00:00Z"
,
"activity_type"
:
"played_video"
,
"count"
:
400
,
"interval_end"
:
"2014-06-01T00:00:00Z"
}
}
]
\ No newline at end of file
analytics_data_api/management/commands/set_api_key.py
View file @
8f9245c3
...
@@ -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 @
8f9245c3
...
@@ -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 @
8f9245c3
...
@@ -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 @
8f9245c3
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