Vin*_*eph 5 google-app-engine python-2.7 google-cloud-storage google-api-python-client
我正在使用带有谷歌应用引擎的云存储API来生成谷歌云存储中存储桶中的文件夹列表.我打算在HTML页面上生成此列表.
yyy
为了这个例子,我打电话给这个桶.这是我的代码库.
from flask import render_template
from flask import Blueprint, redirect, request, abort
from google.appengine.api import users
from thirdpartylib import cloudstorage
admin_routes = Blueprint('admin_routes', __name__)
@admin_routes.before_request
@admin_routes.route('/xxxxx')
def admin_home():
if not users.is_current_user_admin():
return redirect(users.create_login_url(request.url))
files = cloudstorage.listbucket('/yyy', delimiter='/')
paths = [os_path for os_path in files]
return render_template('/df/rain.html', paths=paths)
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是我运行时文件对象是空的dev_appserver.py
.
我知道云存储本身具有最终的一致性.但是我创建了这个桶,它的所有内容都是在三天前上传的.每个项目都有一个公共URL.
我无法弄清楚为什么我看不到JSON
结果.
归档时间: |
|
查看次数: |
461 次 |
最近记录: |