Use correct BASE_URL for the API by default#3804
Merged
AetherUnbound merged 1 commit intomainfrom Feb 20, 2024
Merged
Conversation
BASE_URL for the API by default
sarayourfriend
approved these changes
Feb 17, 2024
Collaborator
sarayourfriend
left a comment
There was a problem hiding this comment.
One to keep in mind for when we switch things over!
krysal
reviewed
Feb 20, 2024
| ] | ||
|
|
||
| BASE_URL = config("BASE_URL", default="https://openverse.org/") | ||
| BASE_URL = config("BASE_URL", default="https://api.openverse.engineering/") |
Member
There was a problem hiding this comment.
I wonder why this variable is here instead of inside the base.py file at the same level 🤔 A curious thing!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes
Fixes #2689 by @AetherUnbound
Description
This PR updates the default value for
BASE_URLon the API (which is the value that ends up being used in production) fromopenverse.orgtoapi.openverse.engineering. TheBASE_URLvalue is used in media reports to construct the item URL, and was constructing an incorrect URL which had the path components of the API but pointed to the frontend. Since this is a computed field, simply deploying this change should correct all the links provided on each of those tables.Testing Instructions
BASE_URL=https://openverse.org/in yourapi/.envfilejust api/initto start the APIAPI_URL=http://localhost:50270 just frontend/run dev:onlyto start the frontendhttps://openverse.org/<api-media-url>, which is incorrectapi/.envvalue to beBASE_URL=http://localhost:50280/, restart the API, and visit the above page to observe the differenceChecklist
Update index.md).main) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin