feat: Add wordpress dataloader and API #62
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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