|
@@ -4,6 +4,7 @@ from rest_framework.request import Request
|
|
|
from django.http import HttpResponse
|
|
|
|
|
|
from ..Clients.CosmohomeClient import generate_xml_task
|
|
|
+from django.conf import settings
|
|
|
|
|
|
|
|
|
class CosmohomeView(viewsets.ViewSet):
|
|
@@ -16,7 +17,7 @@ class CosmohomeView(viewsets.ViewSet):
|
|
|
@classmethod
|
|
|
@action(methods=['get'], detail=False, url_path='xml')
|
|
|
def xml(cls, request: Request, *args, **kwargs) -> HttpResponse:
|
|
|
- file = "artifacts/cosmohome_products.xml"
|
|
|
+ file = settings.BASE_DIR / "artifacts/cosmohome_products.xml"
|
|
|
try:
|
|
|
with open(file, 'rb') as f:
|
|
|
return HttpResponse(f.read(), content_type='text/xml')
|