2
我想創建一個使用shopify python庫的資產,但我得到一個ResourceNotFound異常。以下是我的代碼片段。python api - shopify.Asset 404錯誤
asset = shopify.Asset(dict(key=self.key, theme_id=theme_id))
asset.attach(image.read())
asset.save()
這裏的例外
Traceback:
File "/home/rodxavierbondoc/.virtualenvs/shopify/src/django/django/core/handlers/base.py" in get_response
105. response = middleware_method(request, callback, callback_args, callback_kwargs)
File "/home/rodxavierbondoc/.virtualenvs/shopify/local/lib/python2.7/site-packages/mezzanine/pages/middleware.py" in process_view
45. return view_func(request, *view_args, **view_kwargs)
File "/home/rodxavierbondoc/.virtualenvs/shopify/src/django/django/views/generic/base.py" in view
48. return self.dispatch(request, *args, **kwargs)
File "/home/rodxavierbondoc/.virtualenvs/shopify/src/django/django/utils/decorators.py" in _wrapper
25. return bound_func(*args, **kwargs)
File "/home/rodxavierbondoc/.virtualenvs/shopify/src/django/django/contrib/auth/decorators.py" in _wrapped_view
20. return view_func(request, *args, **kwargs)
File "/home/rodxavierbondoc/.virtualenvs/shopify/src/django/django/utils/decorators.py" in bound_func
21. return func(self, *args2, **kwargs2)
File "/home/rodxavierbondoc/.virtualenvs/shopify/src/django/django/utils/decorators.py" in _wrapper
25. return bound_func(*args, **kwargs)
File "/home/rodxavierbondoc/workspace/sg/djangoproject/shopify_app/decorators.py" in wrapper
10. return func(request, *args, **kwargs)
File "/home/rodxavierbondoc/.virtualenvs/shopify/src/django/django/utils/decorators.py" in bound_func
21. return func(self, *args2, **kwargs2)
File "/home/rodxavierbondoc/workspace/sg/djangoproject/shopify_galleries/views.py" in dispatch
81. return super(UploadImageView, self).dispatch(request, *args, **kwargs)
File "/home/rodxavierbondoc/.virtualenvs/shopify/src/django/django/views/generic/base.py" in dispatch
69. return handler(request, *args, **kwargs)
File "/home/rodxavierbondoc/.virtualenvs/shopify/src/django/django/views/generic/edit.py" in post
138. return self.form_valid(form)
File "/home/rodxavierbondoc/workspace/sg/djangoproject/shopify_galleries/views.py" in form_valid
96. image.store_image(image_field)
File "/home/rodxavierbondoc/workspace/sg/djangoproject/shopify_galleries/models.py" in store_image
62. asset.save()
File "/home/rodxavierbondoc/.virtualenvs/shopify/local/lib/python2.7/site-packages/shopify/base.py" in save
151. return super(ShopifyResource, self).save()
File "/home/rodxavierbondoc/.virtualenvs/shopify/local/lib/python2.7/site-packages/pyactiveresource/activeresource.py" in save
775. data=self.to_xml())
File "/home/rodxavierbondoc/.virtualenvs/shopify/local/lib/python2.7/site-packages/pyactiveresource/connection.py" in put
351. return self._open('PUT', path, headers=headers, data=data)
File "/home/rodxavierbondoc/.virtualenvs/shopify/local/lib/python2.7/site-packages/shopify/base.py" in _open
18. self.response = super(ShopifyConnection, self)._open(*args, **kwargs)
File "/home/rodxavierbondoc/.virtualenvs/shopify/local/lib/python2.7/site-packages/pyactiveresource/connection.py" in _open
287. http_response = self._handle_error(err)
File "/home/rodxavierbondoc/.virtualenvs/shopify/local/lib/python2.7/site-packages/pyactiveresource/connection.py" in _handle_error
407. raise ResourceNotFound(err)
Exception Type: ResourceNotFound at /galleries/upload/
Exception Value: Not Found: https://sawayn-and-sons9677.myshopify.com/admin/themes/3422503/assets.xml
上爲什麼發生這種情況的任何想法的堆棧跟蹤?
歡迎來到StackOverflow!請發佈ResourceNotFound錯誤的完整回溯。 –
編輯了該問題幷包含異常回溯。 –