我在nginx上运行我的django项目时遇到此错误。我使用Dynamodb for数据库和S3来为项目中的静态文件提供服务。在localhost上运行时,项目运行良好。错误:使用Boto时“请求中包含的安全令牌无效”python
该项目最初被托管在另一个ec2实例中,它像魅力一样运行。我从该实例的映像中启动了一个新的ec2实例。现在它抛出这个错误。 的事情是,
the connection works fine when I run some test code on the command line.
但该项目运行时抛出此错误。
JSONResponseError在/
JSONResponseError: 400 Bad Request
{u'message': u'The security token included in the request is invalid.', u'__type': u'com.amazon.coral.service#UnrecognizedClientException'}
Request Method: POST
Request URL: http://ec2-54-200-144-115.us-west-2.compute.amazonaws.com/?attempt=1&code=AQBfOzPR4Hlgrpkjz-qXQj8b7OLq6cm1NM_oZf64Wz3EmlX2-VDS6qfZ5V5f0Tmbx4MrLc4SGuJxUHa8drQClz3A1IWMVqUGKLEEW_0ol1RqClI8cZViWreBm5c3HJ-Vp48Xx81a7gvXSjRNJUn-kazXqahDrgsAeLez_8FrXIb_HWHyekhnUmxgkskRGBNzcTtpqASNe3agzG3ZZowCMYi6bDBAdVuODli3ApWQWENSmjLaN5QbZWbGo3ATvJNMAUQjj6VTHCkVS-UWcuh-PtwAAFtUqb8HkLsbFG31KevwPKz6x10ojD45pe03zA1SF_g
Django Version: 1.5
Exception Type: JSONResponseError
Exception Value:
JSONResponseError: 400 Bad Request
{u'message': u'The security token included in the request is invalid.', u'__type': u'com.amazon.coral.service#UnrecognizedClientException'}
Exception Location: /srv/www/test/local/lib/python2.7/site-packages/boto/dynamodb2/layer1.py in _retry_handler, line 1530
Python Executable: /srv/www/test/bin/python
Python Version: 2.7.3
不能明白是怎么回事。谁能帮我?
您是否检查了您是否正确复制了ACCESS和SECRET键的值?有时你可能会混淆两者。 – Guy
是的,我查过了。事情是,从控制台的连接是好的,但是当我运行该项目时会发生此错误。 –