Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
6016929c
Commit
6016929c
authored
Apr 06, 2016
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Running E-Commerce API data loader with management command
ECOM-3981
parent
604f18bf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
course_discovery/apps/course_metadata/data_loaders.py
+2
-2
course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py
+2
-3
No files found.
course_discovery/apps/course_metadata/data_loaders.py
View file @
6016929c
...
@@ -97,7 +97,7 @@ class OrganizationsApiDataLoader(AbstractDataLoader):
...
@@ -97,7 +97,7 @@ class OrganizationsApiDataLoader(AbstractDataLoader):
count
=
None
count
=
None
page
=
1
page
=
1
logger
.
info
(
'Refreshing Organizations from
%
s...
.
'
,
self
.
api_url
)
logger
.
info
(
'Refreshing Organizations from
%
s...'
,
self
.
api_url
)
while
page
:
while
page
:
response
=
client
.
organizations
()
.
get
(
page
=
page
,
page_size
=
self
.
PAGE_SIZE
)
response
=
client
.
organizations
()
.
get
(
page
=
page
,
page_size
=
self
.
PAGE_SIZE
)
...
@@ -138,7 +138,7 @@ class CoursesApiDataLoader(AbstractDataLoader):
...
@@ -138,7 +138,7 @@ class CoursesApiDataLoader(AbstractDataLoader):
count
=
None
count
=
None
page
=
1
page
=
1
logger
.
info
(
'Refreshing Courses and CourseRuns from
%
s...
.
'
,
self
.
api_url
)
logger
.
info
(
'Refreshing Courses and CourseRuns from
%
s...'
,
self
.
api_url
)
while
page
:
while
page
:
response
=
client
.
courses
()
.
get
(
page
=
page
,
page_size
=
self
.
PAGE_SIZE
)
response
=
client
.
courses
()
.
get
(
page
=
page
,
page_size
=
self
.
PAGE_SIZE
)
...
...
course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py
View file @
6016929c
...
@@ -5,9 +5,7 @@ from django.core.management import BaseCommand
...
@@ -5,9 +5,7 @@ from django.core.management import BaseCommand
from
edx_rest_api_client.client
import
EdxRestApiClient
from
edx_rest_api_client.client
import
EdxRestApiClient
from
course_discovery.apps.course_metadata.data_loaders
import
(
from
course_discovery.apps.course_metadata.data_loaders
import
(
CoursesApiDataLoader
,
CoursesApiDataLoader
,
DrupalApiDataLoader
,
OrganizationsApiDataLoader
,
EcommerceApiDataLoader
DrupalApiDataLoader
,
OrganizationsApiDataLoader
,
)
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -43,4 +41,5 @@ class Command(BaseCommand):
...
@@ -43,4 +41,5 @@ class Command(BaseCommand):
OrganizationsApiDataLoader
(
settings
.
ORGANIZATIONS_API_URL
,
access_token
)
.
ingest
()
OrganizationsApiDataLoader
(
settings
.
ORGANIZATIONS_API_URL
,
access_token
)
.
ingest
()
CoursesApiDataLoader
(
settings
.
COURSES_API_URL
,
access_token
)
.
ingest
()
CoursesApiDataLoader
(
settings
.
COURSES_API_URL
,
access_token
)
.
ingest
()
EcommerceApiDataLoader
(
settings
.
ECOMMERCE_API_URL
,
access_token
)
.
ingest
()
DrupalApiDataLoader
(
settings
.
MARKETING_API_URL
)
.
ingest
()
DrupalApiDataLoader
(
settings
.
MARKETING_API_URL
)
.
ingest
()
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