您好我正在尝试使用
在angularjs app前端打开CSV文件 var fieldsDocumentationAssetUrl = pythonApiBaseUrl + '/static/docs/fields_documentation_asset_api.csv';
var promise = $http.get(fieldsDocumentationAssetUrl).then(function(response){
$scope.fieldsDocumentationAsset = CommonUtils.processCsvFile(response.data);
});
该文件托管在django / python后端。我收到下面的错误,但一般情况下我能够提供静态文件,这个docs文件夹位于静态文件目录中。我在已安装的应用程序等中安装了django staticfiles应用程序。如何提供此文件?
错误:
XMLHttpRequest cannot load http://localhost:5555/static/docs/api/fields_documentation_asset_api.csv. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.