Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Introduce and use new API domain environment variables (#3822)
sarayourfriendeae8c19ead6c
diff --git a/api/Dockerfile b/api/Dockerfileindex 6abcc1e1b..cd3bc5d35 100644--- a/api/Dockerfile+++ b/api/Dockerfile@@ -102,6 +102,7 @@ COPY --chown=opener . /api/RUN env \SETUP_ES="False" \DJANGO_SECRET_KEY="any string" \+ CANONICAL_DOMAIN="" \python manage.py collectstatic# Add the release version to the docker containerdiff --git a/api/api/docs/base_docs.py b/api/api/docs/base_docs.pyindex d2cd6b5b9..483e051af 100644--- a/api/api/docs/base_docs.py+++ b/api/api/docs/base_docs.py@@ -2,6 +2,7 @@ from http.client import responses as http_responsesfrom textwrap import dedentfrom typing import Literal+from django.conf import settingsfrom rest_framework.exceptions import (NotAuthenticated,NotFound,@@ -114,7 +115,7 @@ source_404_response = OpenApiResponse(def build_source_path_parameter(media_type: MediaType):valid_description = (f"Valid values are source_names from the stats endpoint: "- f"https://api.openverse.engineering/v1/{media_type}/stats/."+ f"{settings.CANONICAL_ORIGIN}/v1/{media_type}/stats/.")return OpenApiParameter(diff --git a/api/api/examples/audio_requests.py b/api/api/examples/audio_requests.pyindex f1b9128e3..ed623adc8 100644--- a/api/api/examples/audio_requests.py+++ b/api/api/examples/audio_requests.py@@ -1,10 +1,7 @@-import os+from api.examples.environment import ORIGIN, TOKEN-token = os.getenv("AUDIO_REQ_TOKEN", "DLBYIcfnKfolaXKcmMC8RIDCavc2hW")-origin = os.getenv("AUDIO_REQ_ORIGIN", "https://api.openverse.engineering")--auth = f'-H "Authorization: Bearer {token}"' if token else ""+auth = f'-H "Authorization: Bearer {TOKEN}"' if TOKEN else ""identifier = "8624ba61-57f1-4f98-8a85-ece206c319cf"syntax_examples = {@@ -25,7 +22,7 @@ audio_search_list_curl = "\n".join(# Example {index}: Search for audio {purpose}curl \\{auth} \\- "{origin}/v1/audio/?q={syntax}"+ "{ORIGIN}/v1/audio/?q={syntax}""""for (index, (purpose, syntax)) in enumerate(syntax_examples.items()))@@ -34,28 +31,28 @@ audio_search_curl = f"""# Search for music titled "Wish You Were Here" by The.madpix.projectcurl \\{auth} \\- "{origin}/v1/audio/?title=Wish%20You%20Were%20Here&creator=The.madpix.project"+ "{ORIGIN}/v1/audio/?title=Wish%20You%20Were%20Here&creator=The.madpix.project""""audio_stats_curl = f"""# Get the statistics for audio sourcescurl \\{auth} \\- "{origin}/v1/audio/stats/"+ "{ORIGIN}/v1/audio/stats/""""audio_detail_curl = f"""# Get the details of audio ID {identifier}curl \\{auth} \\- "{origin}/v1/audio/{identifier}/"+ "{ORIGIN}/v1/audio/{identifier}/""""audio_related_curl = f"""# Get related audio files for audio ID {identifier}curl \\{auth} \\- "{origin}/v1/audio/{identifier}/related/"+ "{ORIGIN}/v1/audio/{identifier}/related/""""audio_complain_curl = f"""@@ -65,12 +62,12 @@ curl \\-H "Content-Type: application/json" \\{auth} \\-d '{{"reason": "mature", "description": "This audio contains sensitive content"}}' \\- "{origin}/v1/audio/{identifier}/report/"+ "{ORIGIN}/v1/audio/{identifier}/report/""""audio_waveform_curl = f"""# Get the waveform of audio ID {identifier}curl \\{auth} \\- "{origin}/v1/audio/{identifier}/waveform/"+ "{ORIGIN}/v1/audio/{identifier}/waveform/""""diff --git a/api/api/examples/audio_responses.py b/api/api/examples/audio_responses.pyindex c59f6c198..64dd6f033 100644--- a/api/api/examples/audio_responses.py+++ b/api/api/examples/audio_responses.py@@ -1,8 +1,6 @@-import os+from api.examples.environment import ORIGIN-origin = os.getenv("AUDIO_REQ_ORIGIN", "https://api.openverse.engineering")-identifier = "8624ba61-57f1-4f98-8a85-ece206c319cf"base_audio = {@@ -50,10 +48,10 @@ base_audio = {"duration": 270000,"bit_rate": 128000,"sample_rate": 44100,- "thumbnail": f"{origin}/v1/audio/{identifier}/thumb/",- "detail_url": f"{origin}/v1/audio/{identifier}/",- "related_url": f"{origin}/v1/audio/{identifier}/related/",- "waveform": f"{origin}/v1/audio/{identifier}/waveform/",+ "thumbnail": f"{ORIGIN}/v1/audio/{identifier}/thumb/",+ "detail_url": f"{ORIGIN}/v1/audio/{identifier}/",+ "related_url": f"{ORIGIN}/v1/audio/{identifier}/related/",+ "waveform": f"{ORIGIN}/v1/audio/{identifier}/waveform/","unstable__sensitivity": [],}@@ -124,8 +122,8 @@ audio_related_200_example = {"license_version": "2.0","license_url": "https://creativecommons.org/licenses/by-sa/2.0/","foreign_landing_url": "https://commons.wikimedia.org/w/index.php?curid=3536953", # noqa: E501- "detail_url": "http://api.openverse.engineering/v1/audio/36537842-b067-4ca0-ad67-e00ff2e06b2e", # noqa: E501- "related_url": "http://api.openverse.engineering/v1/recommendations/audio/36537842-b067-4ca0-ad67-e00ff2e06b2e", # noqa: E501+ "detail_url": f"{ORIGIN}/v1/audio/36537842-b067-4ca0-ad67-e00ff2e06b2e", # noqa: E501+ "related_url": f"{ORIGIN}/v1/recommendations/audio/36537842-b067-4ca0-ad67-e00ff2e06b2e", # noqa: E501"fields_matched": ["description", "title"],"tags": [{"name": "exam"}, {"name": "tactics"}],}diff --git a/api/api/examples/environment.py b/api/api/examples/environment.pynew file mode 100644index 000000000..e5848a16c--- /dev/null+++ b/api/api/examples/environment.py@@ -0,0 +1,7 @@+import os+++TOKEN = os.getenv("REQUEST_TOKEN", "<Openverse API token>")+DOMAIN = os.getenv("CANONICAL_DOMAIN")+_proto = "http" if "localhost" in DOMAIN else "https"+ORIGIN = f"{_proto}://{DOMAIN}"diff --git a/api/api/examples/image_requests.py b/api/api/examples/image_requests.pyindex 3524e4745..5c7f6e165 100644--- a/api/api/examples/image_requests.py+++ b/api/api/examples/image_requests.py@@ -1,10 +1,7 @@-import os+from api.examples.environment import ORIGIN, TOKEN-token = os.getenv("AUDIO_REQ_TOKEN", "DLBYIcfnKfolaXKcmMC8RIDCavc2hW")-origin = os.getenv("AUDIO_REQ_ORIGIN", "https://api.openverse.engineering")--auth = f'-H "Authorization: Bearer {token}"' if token else ""+auth = f'-H "Authorization: Bearer {TOKEN}"' if TOKEN else ""identifier = "4bc43a04-ef46-4544-a0c1-63c63f56e276"syntax_examples = {@@ -25,7 +22,7 @@ image_search_list_curl = "\n".join(# Example {index}: Search for images {purpose}curl \\{auth} \\- "{origin}/v1/images/?q={syntax}"+ "{ORIGIN}/v1/images/?q={syntax}""""for (index, (purpose, syntax)) in enumerate(syntax_examples.items()))@@ -34,28 +31,28 @@ image_search_curl = f"""# Search for images titled "Bark" by Sullivancurl \\{auth} \\- "{origin}/v1/images/?title=Bark&creator=Sullivan"+ "{ORIGIN}/v1/images/?title=Bark&creator=Sullivan""""image_stats_curl = f"""# Get the statistics for image sourcescurl \\{auth} \\- "{origin}/v1/images/stats/"+ "{ORIGIN}/v1/images/stats/""""image_detail_curl = f"""# Get the details of image ID {identifier}curl \\{auth} \\- "{origin}/v1/images/{identifier}/"+ "{ORIGIN}/v1/images/{identifier}/""""image_related_curl = f"""# Get related images for image ID {identifier}curl \\{auth} \\- "{origin}/v1/images/{identifier}/related/"+ "{ORIGIN}/v1/images/{identifier}/related/""""image_complain_curl = f"""@@ -65,12 +62,12 @@ curl \\-H "Content-Type: application/json" \\{auth} \\-d '{{"reason": "mature", "description": "Image contains sensitive content"}}' \\- "{origin}/v1/images/{identifier}/report/"+ "{ORIGIN}/v1/images/{identifier}/report/""""image_oembed_curl = f"""# Retrieve embedded content from an image's URLcurl \\{auth} \\- "{origin}/v1/images/oembed/?url=https://wordpress.org/openverse/photos/{identifier}"+ "{ORIGIN}/v1/images/oembed/?url=https://wordpress.org/openverse/photos/{identifier}""""diff --git a/api/api/examples/image_responses.py b/api/api/examples/image_responses.pyindex 1c472c230..7db0ff3a1 100644--- a/api/api/examples/image_responses.py+++ b/api/api/examples/image_responses.py@@ -1,8 +1,6 @@-import os+from api.examples.environment import ORIGIN-origin = os.getenv("AUDIO_REQ_ORIGIN", "https://api.openverse.engineering")-identifier = "4bc43a04-ef46-4544-a0c1-63c63f56e276"base_image = {@@ -53,9 +51,9 @@ base_image = {"mature": False,"height": 4016,"width": 6016,- "thumbnail": f"{origin}/v1/images/{identifier}/thumb/",- "detail_url": f"{origin}/v1/images/{identifier}/",- "related_url": f"{origin}/v1/images/{identifier}/related/",+ "thumbnail": f"{ORIGIN}/v1/images/{identifier}/thumb/",+ "detail_url": f"{ORIGIN}/v1/images/{identifier}/",+ "related_url": f"{ORIGIN}/v1/images/{identifier}/related/","unstable__sensitivity": [],}@@ -120,15 +118,15 @@ image_related_200_example = {"creator_url": "https://www.flickr.com/photos/18090920@N07","tags": [{"name": "exam"}, {"name": "tactics"}],"url": "https://live.staticflickr.com/4065/4459771899_07595dc42e.jpg", # noqa: E501- "thumbnail": "https://api.openverse.engineering/v1/thumbs/610756ec-ae31-4d5e-8f03-8cc52f31b71d", # noqa: E501+ "thumbnail": f"{ORIGIN}/v1/thumbs/610756ec-ae31-4d5e-8f03-8cc52f31b71d", # noqa: E501"provider": "flickr","source": "flickr","license": "by","license_version": "2.0","license_url": "https://creativecommons.org/licenses/by/2.0/","foreign_landing_url": "https://www.flickr.com/photos/18090920@N07/4459771899", # noqa: E501- "detail_url": "http://api.openverse.engineering/v1/images/610756ec-ae31-4d5e-8f03-8cc52f31b71d", # noqa: E501- "related_url": "http://api.openverse.engineering/v1/recommendations/images/610756ec-ae31-4d5e-8f03-8cc52f31b71d", # noqa: E501+ "detail_url": f"{ORIGIN}/v1/images/610756ec-ae31-4d5e-8f03-8cc52f31b71d", # noqa: E501+ "related_url": f"{ORIGIN}/v1/recommendations/images/610756ec-ae31-4d5e-8f03-8cc52f31b71d", # noqa: E501}],}diff --git a/api/api/examples/oauth2_requests.py b/api/api/examples/oauth2_requests.pyindex 4b8222d89..0ab45fcb2 100644--- a/api/api/examples/oauth2_requests.py+++ b/api/api/examples/oauth2_requests.py@@ -1,10 +1,7 @@-import os+from api.examples.environment import ORIGIN, TOKEN-token = os.getenv("AUDIO_REQ_TOKEN", "DLBYIcfnKfolaXKcmMC8RIDCavc2hW")-origin = os.getenv("AUTH_REQ_ORIGIN", "https://api.openverse.engineering")--auth = f'-H "Authorization: Bearer {token}"' if token else ""+auth = f'-H "Authorization: Bearer {TOKEN}"' if TOKEN else ""auth_register_curl = f"""# Register for a key@@ -12,7 +9,7 @@ curl \\-X POST \\-H "Content-Type: application/json" \\-d '{{"name": "My amazing project", "description": "To access Openverse API", "email": "[email protected]"}}' \\- "{origin}/v1/auth_tokens/register/"+ "{ORIGIN}/v1/auth_tokens/register/"""" # noqa: E501auth_token_curl = f"""@@ -20,12 +17,12 @@ auth_token_curl = f"""curl \\-X POST \\-H "Content-Type: application/x-www-form-urlencoded" \\- -d 'grant_type=client_credentials&client_id=pm8GMaIXIhkjQ4iDfXLOvVUUcIKGYRnMlZYApbda&client_secret=YhVjvIBc7TuRJSvO2wIi344ez5SEreXLksV7GjalLiKDpxfbiM8qfUb5sNvcwFOhBUVzGNdzmmHvfyt6yU3aGrN6TAbMW8EOkRMOwhyXkN1iDetmzMMcxLVELf00BR2e' \\- "{origin}/v1/auth_tokens/token/"+ -d 'grant_type=client_credentials&client_id=<Openverse API client ID>&client_secret=<Openverse API client secret>' \\+ "{ORIGIN}/v1/auth_tokens/token/"""" # noqa: E501auth_key_info_curl = f"""curl \\{auth} \\- "{origin}/v1/rate_limit/"+ "{ORIGIN}/v1/rate_limit/""""diff --git a/api/api/examples/oauth2_responses.py b/api/api/examples/oauth2_responses.pyindex d6859f6f5..54173f607 100644--- a/api/api/examples/oauth2_responses.py+++ b/api/api/examples/oauth2_responses.py@@ -1,17 +1,14 @@auth_register_201_example = {"application/json": {"name": "My amazing project",- "client_id": "pm8GMaIXIhkjQ4iDfXLOvVUUcIKGYRnMlZYApbda",- "client_secret": (- "YhVjvIBc7TuRJSvO2wIi344ez5SEreXLksV7GjalLiKDpxfbiM8qfUb5sNvcwFOh"- "BUVzGNdzmmHvfyt6yU3aGrN6TAbMW8EOkRMOwhyXkN1iDetmzMMcxLVELf00BR2e"- ),+ "client_id": "<Openverse API client ID>",+ "client_secret": "<Openverse API client secret>",}}auth_token_200_example = {"application/json": {- "access_token": "DLBYIcfnKfolaXKcmMC8RIDCavc2hW",+ "access_token": "<Openverse API token>","scope": "read write groups","expires_in": 36000,"token_type": "Bearer",diff --git a/api/api/models/media.py b/api/api/models/media.pyindex fead18dcc..e7c9fac3f 100644--- a/api/api/models/media.py+++ b/api/api/models/media.py@@ -145,8 +145,6 @@ class AbstractMediaReport(models.Model):deleted_class: type[models.Model] = None"""the class storing deleted media e.g. ``DeletedImage`` or ``DeletedAudio``"""- BASE_URL = settings.BASE_URL-REPORT_CHOICES = [(MATURE, MATURE), (DMCA, DMCA), (OTHER, OTHER)]STATUS_CHOICES = [@@ -201,9 +199,7 @@ class AbstractMediaReport(models.Model):)def url(self, media_type):- url = (- f"{AbstractMediaReport.BASE_URL}v1/{media_type}/{self.media_obj.identifier}"- )+ url = f"{settings.CANONICAL_ORIGIN}v1/{media_type}/{self.media_obj.identifier}"return format_html(f"<a href={url}>{url}</a>")def save(self, *args, **kwargs):diff --git a/api/api/serializers/media_serializers.py b/api/api/serializers/media_serializers.pyindex 350d416a6..26fdd521e 100644--- a/api/api/serializers/media_serializers.py+++ b/api/api/serializers/media_serializers.py@@ -633,7 +633,7 @@ def get_search_request_source_serializer(media_type):"help_text": ("A comma separated list of data sources; valid values are ""``source_name``s from the stats endpoint: "- f"https://api.openverse.engineering/v1/{media_path}/stats/."+ f"{settings.CANONICAL_ORIGIN}/v1/{media_path}/stats/."),"required": False,}diff --git a/api/conf/settings/security.py b/api/conf/settings/security.pyindex cf78fda38..5eca87052 100644--- a/api/conf/settings/security.py+++ b/api/conf/settings/security.py@@ -16,27 +16,38 @@ SECRET_KEY = config("DJANGO_SECRET_KEY") # required# SECURITY WARNING: don't run with debug turned on in production!DEBUG = config("DJANGO_DEBUG_ENABLED", default=False, cast=bool)-ALLOWED_HOSTS = config("ALLOWED_HOSTS", default="").split(",") + [+# The domain we treat as "canonical" for this API instance, e.g., `api.` subdomain for production+CANONICAL_DOMAIN: str = config("CANONICAL_DOMAIN") # required++_proto = "http" if "localhost" in CANONICAL_DOMAIN else "https"+CANONICAL_ORIGIN: str = f"{_proto}://{CANONICAL_DOMAIN}"++# Additional domains we serve for this API instance, e.g., `api-production.` subdomain for production+ADDITIONAL_DOMAINS: list[str] = config(+ "ADDITIONAL_DOMAINS", default="", cast=lambda x: x.split(",")+)++ALL_DOMAINS = [CANONICAL_DOMAIN] + ADDITIONAL_DOMAINS++ALLOWED_HOSTS = [+ # Strip ports off hosts, as ALLOWED_HOSTS does not work with ports, e.g., `localhost:8000` needs to be just `localhost`+ domain.split(":")[0]+ for domain in ALL_DOMAINS+] + [gethostname(),gethostbyname(gethostname()),]-if lb_url := config("LOAD_BALANCER_URL", default=""):- ALLOWED_HOSTS.append(lb_url)-if DEBUG:ALLOWED_HOSTS += ["dev.openverse.test", # used in local development- "localhost","127.0.0.1","0.0.0.0",]-BASE_URL = config("BASE_URL", default="https://api.openverse.engineering/")-# Trusted origins for CSRF# https://docs.djangoproject.com/en/4.2/ref/settings/#csrf-trusted-origins-CSRF_TRUSTED_ORIGINS = ["https://*.openverse.engineering"]+CSRF_TRUSTED_ORIGINS = [f"{_proto}://{domain}" for domain in ALL_DOMAINS]# Allow anybody to access the API from any domainif "corsheaders" not in INSTALLED_APPS:@@ -57,8 +68,6 @@ CORS_EXPOSE_HEADERS = [# Proxy handling, for productionif config("IS_PROXIED", default=True, cast=bool):- # https://docs.djangoproject.com/en/4.0/ref/settings/#use-x-forwarded-host- USE_X_FORWARDED_HOST = True# https://docs.djangoproject.com/en/4.0/ref/settings/#secure-proxy-ssl-headerSECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")diff --git a/api/env.docker b/api/env.dockerindex daf913ecf..179c61027 100644--- a/api/env.docker+++ b/api/env.docker@@ -4,9 +4,13 @@ DJANGO_SETTINGS_MODULE=conf.settingsDJANGO_SECRET_KEY=example_keyDJANGO_DEBUG_ENABLED=True-BASE_URL=http://localhost:50280/+CANONICAL_DOMAIN=localhost:50280+# Use the same port inside the container, as outside, so that references to CANONICAL_DOMAIN work inside the container+# Otherwise, `localhost:50280` inside the container wouldn't work, due to 50280 being the port mapped on the host, without+# the actual port matching (usually defaulting to 8000).+PORT=50280+ALTERNATIVE_DOMAINS=172.17.0.1,host.docker.internalENVIRONMENT=local-ALLOWED_HOSTS=api.openverse.engineering,api-dev.openverse.engineering,host.docker.internalREDIS_HOST=cachediff --git a/api/env.template b/api/env.templateindex 0c0cc84bc..a6d6f9b6e 100644--- a/api/env.template+++ b/api/env.template@@ -4,10 +4,8 @@ DJANGO_SETTINGS_MODULE=conf.settingsDJANGO_SECRET_KEY=example_keyDJANGO_DEBUG_ENABLED=True-BASE_URL=http://localhost:50280/+CANONICAL_DOMAIN=localhost:50280ENVIRONMENT=local-# List of comma-separated hosts/domain names, e.g., 127.17.0.1,local.app-ALLOWED_HOSTS=localhost,172.17.0.1,host.docker.internal#LOAD_BALANCER_URL=diff --git a/api/run.py b/api/run.pyindex 36938287d..4fc6be16c 100644--- a/api/run.py+++ b/api/run.py@@ -1,15 +1,15 @@-import os-import uvicorn+from decouple import configif __name__ == "__main__":- is_local = os.getenv("ENVIRONMENT") == "local"+ is_local = config("ENVIRONMENT") == "local"+ port: int = config("PORT", default="8000", cast=int)uvicorn.run("conf.asgi:application",host="0.0.0.0",- port=8000,+ port=port,workers=1,reload=is_local,log_level="debug",diff --git a/api/test/__init__.py b/api/test/__init__.pyindex 205a8f127..e69de29bb 100644--- a/api/test/__init__.py+++ b/api/test/__init__.py@@ -1,5 +0,0 @@-from test.utils import show_env_name---print("\n")-show_env_name()diff --git a/api/test/constants.py b/api/test/constants.pydeleted file mode 100644index 7254fe5ac..000000000--- a/api/test/constants.py+++ /dev/null@@ -1,10 +0,0 @@-import os---API_URL = os.getenv("INTEGRATION_TEST_URL", "http://localhost:8000")--KNOWN_ENVS = {- "http://localhost:8000": "LOCAL",- "https://api.openverse.engineering": "PRODUCTION",- "https://api-dev.openverse.engineering": "TESTING",-}diff --git a/api/test/integration/test_auth.py b/api/test/integration/test_auth.pyindex b6a7b4921..d0e798af1 100644--- a/api/test/integration/test_auth.py+++ b/api/test/integration/test_auth.py@@ -1,13 +1,13 @@import timeimport uuid+from django.conf import settingsfrom django.urls import reverseimport pytestfrom oauth2_provider.models import AccessTokenfrom api.models import OAuth2Verification, ThrottledApplication-from test.constants import API_URLcache_availability_params = pytest.mark.parametrize(@@ -98,7 +98,7 @@ def _integration_verify_most_recent_token(api_client):)@cache_availability_params@pytest.mark.skipif(- API_URL != "http://localhost:8000",+ "localhost" not in settings.CANONICAL_DOMAIN,reason=("This test needs to cheat by looking in the database,"" so it needs to skip in non-local environments where"diff --git a/api/test/test_examples.py b/api/test/test_examples.pyindex e7ff9d648..858c54a21 100644--- a/api/test/test_examples.py+++ b/api/test/test_examples.py@@ -2,14 +2,13 @@ import jsonimport osimport subprocess-import pytest+from django.conf import settings-from test.constants import API_URL+import pytest-os.environ["AUDIO_REQ_TOKEN"] = ""-os.environ["AUDIO_REQ_ORIGIN"] = API_URL-os.environ["AUDIO_REQ_IDX"] = "8624ba61-57f1-4f98-8a85-ece206c319cf"+os.environ["REQUEST_TOKEN"] = ""+os.environ["CANONICAL_DOMAIN"] = settings.CANONICAL_DOMAINfrom api.examples import ( # noqa: E402 | Set env vars before importaudio_mappings,@@ -18,8 +17,12 @@ from api.examples import ( # noqa: E402 | Set env vars before importdef execute_request(request):- proc = subprocess.run(request, check=True, capture_output=True, shell=True)- return json.loads(proc.stdout)+ try:+ proc = subprocess.run(request, check=True, capture_output=True, shell=True)+ return json.loads(proc.stdout)+ except subprocess.CalledProcessError as e:+ print(e.stderr)+ raise@pytest.mark.parametrize("in_val, out_val", list(audio_mappings.items()))diff --git a/api/test/test_schema.py b/api/test/test_schema.pyindex 38219f027..16d10df0e 100644--- a/api/test/test_schema.py+++ b/api/test/test_schema.py@@ -1,9 +1,9 @@-import schemathesis+from django.conf import settings-from test.constants import API_URL+import schemathesis-schema = schemathesis.from_uri(f"{API_URL}/v1/schema/")+schema = schemathesis.from_uri(f"{settings.CANONICAL_ORIGIN}/v1/schema/")@schema.parametrize()diff --git a/api/test/utils.py b/api/test/utils.pydeleted file mode 100644index 37af9250f..000000000--- a/api/test/utils.py+++ /dev/null@@ -1,7 +0,0 @@-from test.constants import API_URL, KNOWN_ENVS---def show_env_name():- env_name = KNOWN_ENVS.get(API_URL, "unknown")- message = f"with API {API_URL}" if env_name == "unknown" else ""- print(f"Testing {env_name} environment {message}")diff --git a/docker-compose.yml b/docker-compose.ymlindex 7e87d00e6..df894f222 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -228,7 +228,7 @@ services:volumes:- ./api:/api:zports:- - "50280:8000" # Django+ - "50280:50280"depends_on:- db- es@@ -300,7 +300,7 @@ services:ports:- "50270:8080"environment:- DJANGO_NGINX_UPSTREAM_URL: web:8000+ DJANGO_NGINX_UPSTREAM_URL: web:50280depends_on:- web