bradleyg / django-s3direct

Directly upload files to S3 compatible services with Django.
MIT License
661 stars 234 forks source link

Closing out, if this is still an issue feel free to reopen. #233

Open kahdichienja opened 3 years ago

kahdichienja commented 3 years ago

Closing out, if this is still an issue feel free to reopen.

Thanks

Originally posted by @bradleyg in https://github.com/bradleyg/django-s3direct/issues/151#issuecomment-455873208

SAME ISSUE OVER HERE Traceback (most recent call last): File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) psycopg2.ProgrammingError: can't adapt type 'InMemoryUploadedFile'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/core/handlers/base.py", line 126, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/core/handlers/base.py", line 124, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view return view_func(*args, *kwargs) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/views/generic/base.py", line 68, in view return self.dispatch(request, args, kwargs) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/rest_framework/views.py", line 497, in dispatch response = self.handle_exception(exc) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/rest_framework/views.py", line 457, in handle_exception self.raise_uncaught_exception(exc) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/rest_framework/views.py", line 468, in raise_uncaught_exception raise exc File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/rest_framework/views.py", line 494, in dispatch response = handler(request, *args, kwargs) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/rest_framework/generics.py", line 190, in post return self.create(request, args, kwargs) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/rest_framework/mixins.py", line 19, in create self.perform_create(serializer) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/rest_framework/mixins.py", line 24, in perform_create serializer.save() File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/rest_framework/serializers.py", line 213, in save self.instance = self.create(validated_data) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/rest_framework/serializers.py", line 932, in create instance = ModelClass._default_manager.create(validated_data) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(args, kwargs) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/models/query.py", line 413, in create obj.save(force_insert=True, using=self.db) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/models/base.py", line 717, in save self.save_base(using=using, force_insert=force_insert, File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/models/base.py", line 748, in save_base updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/models/base.py", line 831, in _save_table result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/models/base.py", line 868, in _do_insert return manager._insert([self], fields=fields, return_id=update_pk, File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/models/query.py", line 1136, in _insert return query.get_compiler(using=using).execute_sql(return_id) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1289, in execute_sql cursor.execute(sql, params) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/backends/utils.py", line 100, in execute return super().execute(sql, params) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/backends/utils.py", line 68, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers return executor(sql, params, many, context) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/utils.py", line 89, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/home/ago/Desktop/test/maberrr/maberrvenv/lib/python3.8/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: can't adapt type 'InMemoryUploadedFile'