Features: 1) Update DeepL API URL to standard endpoint in deepl_translate.py and translate_fields.py;

Fixes: 1) None;

Extra: 1) Replaced deprecated API-free URL with standard DeepL API URL for consistency.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-05-21 15:31:08 +03:00
parent 797e56a0cd
commit 88133b2f93
2 changed files with 2 additions and 2 deletions

View file

@ -207,7 +207,7 @@ class Command(BaseCommand):
('auth_key', auth_key),
('target_lang', api_code),
] + [('text', t) for t in protected]
resp = requests.post('https://api-free.deepl.com/v2/translate', data=data)
resp = requests.post('https://api.deepl.com/v2/translate', data=data)
try:
resp.raise_for_status()
result = resp.json()

View file

@ -5,7 +5,7 @@ import requests
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
DEEPL_API_URL = "https://api-free.deepl.com/v2/translate"
DEEPL_API_URL = "https://api.deepl.com"
DEEPL_TARGET_LANGUAGES_MAPPING = {
"en-gb": "EN-GB",