-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDAIA-13 Wordpress Dataloader API #61
Conversation
The code looks good to me, however, some tests are failing. Please have a look before merging the changes. |
005954c
to
a625547
Compare
course_discovery/settings/assets.py
Outdated
LOGGING["handlers"].pop("local") | ||
for logger in LOGGING["loggers"].values(): | ||
if "local" in logger["handlers"]: | ||
logger["handlers"].remove("local") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an empty line in this file.
@@ -393,23 +392,23 @@ def _load_ecommerce_data(self): | |||
# Process in batches and wait for the result from the futures | |||
pagerange = pageranges['course_runs'] | |||
for future in concurrent.futures.as_completed( | |||
executor.submit(self._request_course_runs, page) for page in pagerange | |||
executor.submit(self._request_course_runs, page) for page in pagerange |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reset unnecessary changes in this file i.e. formatting changes
a625547
to
77a0a10
Compare
Description
Wordpress DataLoader API
which is used to sync data with Wordpress.Dataloader API:
{DISCOVERY_URL}/api/v1/dataloader_app/dataloader/
CourseRun APIs:
{DISCOVERY_URL}/api/v1/dataloader_app/search/course_runs/
,{DISCOVERY_URL}/api/v1/dataloader_app/course_runs/
Flow: When
Publish
button of course is pressed in Wordpress,Wordpress
hit the API to dataloader which triggers thedata loader task
. Thedataloader task
hit the API towordpress
for getting courses data. The courses data is then updated into the correspondingcourse_runs
. Moreover, It also creates or updates theSubject
(category
in Wordpress) andPeople
(Instructor
in Wordpress) data.Supporting information
JIRA Link: https://edlyio.atlassian.net/browse/SDAIA-13
Configurations/Additional Information
wordpress
related plugins should be installed.tutor plugin common
should be installed with the following config fields.tutor/config.yml
sdaia
source in discovery django adminhttp://{DISCOVERY_URL}/admin/course_metadata/source/
. It should match with theDISCOVERY_PRODUCT_SOURCE_SLUG
entered above inconfig.yml
http://wordpress.local.overhang.io/wp-json/
inMarketing Site API URL
field ofPartner
model in Course Discovery django admin.python -m celery -A course_discovery worker -l info
Other Important Info related to
fetch courses
API for wordpress:profile_image_url
andmarketing_url
of Instructor is mapped tomajor_works
field as json object.permalink
of Wordpress Category is mapped tobanner_image_url
field of Subject.featured
of wordpress Course is mapped tocourse_overridden
field of Course Run.Testing instructions
N/A
Merge checklist:
sdaia-dev
branch before merge after reviewing.Post merge:
Screenshots:
Other information
multi_email_field
error, thenpip install django-multi-email-field
python manage.py migrate