Consulting companies and software vendors might also build on and use both Azure and AWS, as these platforms represent most of the cloud market demand.įor an overview of Azure for AWS users, see Introduction to Azure for AWS professionals. Yet many organizations choose to use both platforms together for greater choice and flexibility, as well as to spread their risk and dependencies with a multicloud approach. Azure and AWS for multicloud solutionsĪs the leading public cloud platforms, Azure and AWS each offer a broad and deep set of capabilities with global coverage. Not every AWS service or Azure service is listed, and not every matched service has exact feature-for-feature parity. This article compares services that are roughly comparable. Whether you are planning a multicloud solution with Azure and AWS, or migrating to Azure, you can compare the IT capabilities of Azure and AWS services in all categories. Result = super().This article helps you understand how Microsoft Azure services compare to Amazon Web Services (AWS). # Upload the object which will auto close the content_autoclose instance # Write our original content into our copy that will be closed by boto3Ĭontent_autoclose.write(content.read().strip()) # Create a temporary file that will write to disk after a specified sizeĬontent_autoclose = self.new_temporary_file()
The file upon upload where as the storage backend expects it to still be open We create a clone of the content file as when this is passed to boto3 it wrongly closes I also have a custom S3 storage handler: class CustomS3Storage(S3Storage,ABC): UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa2 in position 50: invalid start byte Ret = renderer.render(self.data, accepted_media_type, context)įile "/Users/jakobkarlstrand/Documents/Programming/weknowit/HaningeBostader/backend/venv/lib/python3.9/site-packages/rest_framework/renderers.py", line 100, in renderįile "/Users/jakobkarlstrand/Documents/Programming/weknowit/HaningeBostader/backend/venv/lib/python3.9/site-packages/rest_framework/utils/json.py", line 25, in dumpsĬhunks = erencode(o, _one_shot=True)įile "/Users/jakobkarlstrand/Documents/Programming/weknowit/HaningeBostader/backend/venv/lib/python3.9/site-packages/rest_framework/utils/encoders.py", line 50, in default Response = self.process_exception_by_middleware(e, request)įile "/Users/jakobkarlstrand/Documents/Programming/weknowit/HaningeBostader/backend/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 143, in _get_responseįile "/Users/jakobkarlstrand/Documents/Programming/weknowit/HaningeBostader/backend/venv/lib/python3.9/site-packages/django/template/response.py", line 105, in renderįile "/Users/jakobkarlstrand/Documents/Programming/weknowit/HaningeBostader/backend/venv/lib/python3.9/site-packages/rest_framework/response.py", line 70, in rendered_content The model is correctly added and all files are stored, but either way I get an 500 response with UnicodeDecodeErrorįile "/Users/jakobkarlstrand/Documents/Programming/weknowit/HaningeBostader/backend/venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 34, in innerįile "/Users/jakobkarlstrand/Documents/Programming/weknowit/HaningeBostader/backend/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 145, in _get_response (file=a,jourreport=report) # Add attachments to instance If "additional_workers" in validated_data: Serializer class JourReportCreateUpdateSerializer(serializers.ModelSerializer):įields = ('apartment_number', 'address', 'tenant_name','tenant_phone', 'debit_tenant','worker','total_hours', 'additional_workers','defect_description','actions_made','actions_to_be_made')Īttachments = ntext Return SuccessfulResponse(data=request.data, message="Jour report successfully registered!" ,status_code=status_code) Valid = serializer.is_valid(raise_exception=True) Serializer = JourReportCreateUpdateSerializer(data=request.data,partial=True,context=) If not user_is_admin(user_making_request):Īttachments = ('attachment', None) Serializer_class = JourReportListSerializer Jourreport = models.ForeignKey(JourReport,related_name="jourattachments", on_delete=models.CASCADE) My file model class JourAttachment(models.Model): When I upload a file I get an UnicodeDecodeError as follows.
I store the files at AWS S3, and I'm using Django S3 Storage. I'm using Django Rest Framework, and with a simple form on the frontend I upload some data, and attachments to a model in Django.