1

我正在关注https://github.com/Shopify/shopify_python_api上的教程,但在第 4 步,我总是收到“500 内部服务器错误”。

我不确定我是否正确地遵循了这些步骤。

在第 3 步之后,我在浏览器中访问 URL,permission_url单击“安装”,然后将重定向到的 URL 中的数据复制到dict名为params.

在执行第 4 步时,我得到:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File ".../lib/python2.7/site-packages/shopify/session.py", line 53, in __init__
    self.token = self.request_token(params['code'])
  File ".../lib/python2.7/site-packages/shopify/session.py", line 90, in request_token
    response = connection.post(access_token_path, ShopifyResource.headers)
  File ".../lib/python2.7/site-packages/pyactiveresource/connection.py", line 313, in post
    return self._open('POST', path, headers=headers, data=data)
  File ".../lib/python2.7/site-packages/shopify/base.py", line 18, in _open
    self.response = super(ShopifyConnection, self)._open(*args, **kwargs)
  File ".../lib/python2.7/site-packages/pyactiveresource/connection.py", line 258, in _open
    response = Response.from_httpresponse(self._handle_error(err))
  File ".../lib/python2.7/site-packages/pyactiveresource/connection.py", line 367, in _handle_error
    raise ServerError(err)
ServerError: HTTP Error 500: Internal Server Error
4

1 回答 1

1

对于私有应用程序,您无需通过授权步骤来获取令牌。令牌只是私人应用程序密码。所以激活一个会话只需要做:

session = shopify.Session(SHOP_URL)
session.token = PRIVATE_APPLICATION_PASSWORD
shopify.ShopifyResource.activate_session(session)
于 2012-07-27T13:28:09.140 回答