Hi guys,
I have a simple blog project. When I go to my domain www.nomadpad.io I get "Server Error 500"
From the error log below, it appears to be something to do with my editedimage field, which looks like this in my models.py :
editedimage = ProcessedImageField(upload_to="images", blank=True, null=True,
processors = [Transpose()],
format="JPEG")
This all works fine in my development environment. I can still access my live django-admin page, and when I try to upload an image, when I save the post, it returns again the Server Error 500.
2018-02-25 04:19:37,291: Internal Server Error: /#012Traceback (most recent call last):#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 882, in _resolve_lookup#012 current = current[bit]#012TypeError: 'ProcessedImageFieldFile' object is not subscriptable#012#012During handling of the above exception, another exception occurred:#012#012Traceback (most recent call last):#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner#012 response = get_response(request)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response#012 response = self.process_exception_by_middleware(e, request)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response#012 response = wrapped_callback(request, callback_args, callback_kwargs)#012 File "/home/DMells123/nomadpad/posts/views.py", line 24, in getAllPosts#012 return render(request, 'posts/getAllPosts.html', context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/shortcuts.py", line 30, in render#012 content = loader.render_to_string(template_name, context, request, using=using)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/loader.py", line 68, in render_to_string#012 return template.render(context, request)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/backends/django.py", line 66, in render#012 return self.template.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 207, in render#012 return self._render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 199, in _render#012 return self.nodelist.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 990, in render#012 bit = node.render_annotated(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated#012 return self.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/loader_tags.py", line 177, in render#012 return compiled_parent._render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 199, in _render#012 return self.nodelist.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 990, in render#012 bit = node.render_annotated(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated#012 return self.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/loader_tags.py", line 72, in render#012 result = block.nodelist.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 990, in render#012 bit = node.render_annotated(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated#012 return self.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/defaulttags.py", line 322, in render#012 return nodelist.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 990, in render#012 bit = node.render_annotated(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated#012 return self.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/defaulttags.py", line 216, in render#012 nodelist.append(node.render_annotated(context))#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated#012 return self.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 1040, in render#012 output = self.filter_expression.resolve(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 708, in resolve#012 obj = self.var.resolve(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 849, in resolve#012 value = self._resolve_lookup(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 890, in _resolve_lookup#012 current = getattr(current, bit)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/db/models/fields/files.py", line 69, in url#012 self._require_file()#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/db/models/fields/files.py", line 46, in _require_file#012 raise ValueError("The '%s' attribute has no file associated with it." % self.field.name)#012ValueError: The 'editedimage' attribute has no file associated with it. 2018-02-25 04:19:41,460: Internal Server Error: /#012Traceback (most recent call last):#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 882, in _resolve_lookup#012 current = current[bit]#012TypeError: 'ProcessedImageFieldFile' object is not subscriptable#012#012During handling of the above exception, another exception occurred:#012#012Traceback (most recent call last):#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner#012 response = get_response(request)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response#012 response = self.process_exception_by_middleware(e, request)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response#012 response = wrapped_callback(request, callback_args, **callback_kwargs)#012 File "/home/DMells123/nomadpad/posts/views.py", line 24, in getAllPosts#012 return render(request, 'posts/getAllPosts.html', context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/shortcuts.py", line 30, in render#012 content = loader.render_to_string(template_name, context, request, using=using)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/loader.py", line 68, in render_to_string#012 return template.render(context, request)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/backends/django.py", line 66, in render#012 return self.template.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 207, in render#012 return self._render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 199, in _render#012 return self.nodelist.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 990, in render#012 bit = node.render_annotated(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated#012 return self.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/loader_tags.py", line 177, in render#012 return compiled_parent._render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 199, in _render#012 return self.nodelist.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 990, in render#012 bit = node.render_annotated(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated#012 return self.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/loader_tags.py", line 72, in render#012 result = block.nodelist.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 990, in render#012 bit = node.render_annotated(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated#012 return self.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/defaulttags.py", line 322, in render#012 return nodelist.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 990, in render#012 bit = node.render_annotated(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated#012 return self.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/defaulttags.py", line 216, in render#012 nodelist.append(node.render_annotated(context))#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated#012 return self.render(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 1040, in render#012 output = self.filter_expression.resolve(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 708, in resolve#012 obj = self.var.resolve(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 849, in resolve#012 value = self._resolve_lookup(context)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/template/base.py", line 890, in _resolve_lookup#012 current = getattr(current, bit)#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/db/models/fields/files.py", line 69, in url#012 self._require_file()#012 File "/home/DMells123/.virtualenvs/nomadpadvenv/lib/python3.6/site-packages/django/db/models/fields/files.py", line 46, in _require_file#012 raise ValueError("The '%s' attribute has no file associated with it." % self.field.name)#012ValueError: The 'editedimage' attribute has no file associated with it.