Jak opravit InvenTree remote_image: Downloading images from remote URL is not enabled

Problém:

Při pokusu create InvenTree object pomocí remote_image URL, vidíte error message jako

inventree_remote_image_error.txt
requests.exceptions.HTTPError: {'detail': 'Error occurred during API request', 'url': 'https://inventree-test.mydomain.com/api/company/', 'method': 'POST', 'status_code': 400, 'body': '{"remote_image":["Downloading images from remote URL is not enabled"]}', 'headers': {'AUTHORIZATION': 'Token 6daae3817756e9c1a3603b14d9582e61f50db388'}, 'params': {'format': 'json'}, 'data': {'name': 'DigiKey', 'website': 'https://www.digikey.de/', 'remote_image': 'https://logodix.com/logo/1667872.jpg', 'description': '', 'is_manufacturer': False, 'is_supplier': True, 'is_customer': False, 'currency': 'EUR'}}

Řešení

Otevřete InvenTree webinterface, otevřete Server Configuration vlevo

InvenTree web interface showing Server Configuration menu entry on the left sidebar

a enable Download from URL.

InvenTree server configuration settings with Download from URL option enabled

Setting bude effective immediately. Není nutné klikat na jakékoliv Apply button nebo restartovat server.


Podívejte se na podobné články podle kategorie: Allgemein