-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Currently the API base URL is hardcoded to a single region:
API_BASE_URL = "https://eu.edstem.org/api/"This means users on other regions (US, AU) need to manually edit the source.
Proposal:
Add a region parameter to EdAPI.__init__:
class EdAPI:
def __init__(self, region: str = "us"):
subdomain = "" if region == "us" else f"{region}."
self.api_base_url = f"https://{subdomain}edstem.org/api/"
self.static_file_base_url = f"https://static.{subdomain}edusercontent.com/files/"
# ...Then update all urljoin(API_BASE_URL, ...) calls to use self.api_base_url.
Happy to submit a PR if you're open to this.
Metadata
Metadata
Assignees
Labels
No labels