Django存储AWS_QUERYSTRING_AUTH不工作

时间:2015-10-04 23:47:56

标签: python django amazon-s3 boto

我一直试图解决这个问题,到目前为止我无法自己解决这个问题。关于我的问题的反向,有几个不同的帖子,不想在S3网址中进行身份验证。

我在我的//User inputs, just for testing $active = 0; $modifier = 5; $lootsearch = 'item'; $limits = 3; $max = 5; //Conditional binding $bindParam = new BindParam(); $binds = array(); $binds[] = 'active = ?'; $bindParam->add('i', $active); $query = "SELECT * FROM re_tblcombinationlist WHERE "; if (!empty($modifier)) { $binds[] = ' AND ModifierKey = ?'; $bindParam->add('s', $modifier); } if (!empty($lootsearch)) { $binds[] = ' AND (LootItem1Key LIKE ? OR LootItem2Key LIKE ?) '; $bindParam->add('s', $lootsearch); $bindParam->add('s', $lootsearch); } $query .= implode(" ", $binds);//removed the AND to allow for AND and OR $query .= " ORDER BY ReportedOn DESC LIMIT ? , ?"; $bindParam->add('i', $limits); $bindParam->add('i', $max); //Uncomment this for debugging //echo $query . '<br/>'; //Using the above user inputs query should be: //SELECT * FROM re_tblcombinationlist WHERE active = ? AND ModifierKey = ? AND (LootItem1Key LIKE ? OR LootItem2Key LIKE ?) ORDER BY ReportedOn DESC LIMIT ? , ? //var_dump($bindParam->get()); //Maybe you have to experiment a bit with those lines $stmt = $conn->prepare($query); call_user_func_array(array($stmt, 'bind_param'), $bindParam->get());//Required in order to use the array given by bindParam->get() $recent1 = infoo($stmt);

中使用了Django-Storages
settings.py

保存或列出文件没有问题,但没有网址具有身份验证查询字符串。

返回example of the url

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:3)

答案是django-storages查询字符串与自定义域不兼容。