forked from openedx/course-discovery
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from edly-io/farhan/EDLY-5506
feat:Add command to automate Setup Edly Multisite Devstack Locally ED…
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
course_discovery/apps/core/management/commands/setup_course_discovery_service.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" Management command to set up course discovery service locally""" | ||
|
||
from course_discovery.apps.core.models import Partner | ||
from django.contrib.sites.models import Site | ||
from django.core.management.base import BaseCommand | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Set up course discovery service locally' | ||
domain_name = 'edx.devstack.lms:18381' | ||
|
||
def setup_course_discovery_service(self): | ||
site, _ = Site.objects.get_or_create(name=self.domain_name, domain=self.domain_name) | ||
Partner.objects.get_or_create( | ||
name='edx.devstack.lms:18381', short_code='edly', | ||
lms_url='http://edx.devstack.lms:18000', site=site, | ||
courses_api_url='http://edx.devstack.lms:18000/api/courses/v1/', | ||
ecommerce_api_url='http://edx.devstack.lms:18130/api/v2/', | ||
marketing_site_url_root='http://wordpress.edx.devstack.lms/', | ||
marketing_site_api_url='http://wordpress.edx.devstack.lms/wp-json/edly/v1/course_runs', | ||
studio_url='http://edx.devstack.lms:18010' | ||
) | ||
|
||
def handle(self, *args, **options): | ||
"""Set up course discovery service locally.""" | ||
self.setup_course_discovery_service() |