Я пытаюсь сделать резервную копию, но не получится:
2011-10-01 09:22:43.706 /remote_api 302 5ms 0cpu_ms 0kb
213.89.134.0 - - [01/Oct/2011:05:22:43 -0700] "GET /remote_api HTTP/1.1" 302 0 - - "montaoproject.appspot.com" ms=6 cpu_ms=0 api_cpu_ms=0 cpm_usd=0.000032
$ python ./appcfg.py download_data --application=montaoproject --url=http://montaoproject.appspot.com/remote_api --filename=montao.data
Downloading data records.
[INFO ] Logging to bulkloader-log-20111001.122234
[INFO ] Throttling transfers:
[INFO ] Bandwidth: 250000 bytes/second
[INFO ] HTTP connections: 8/second
[INFO ] Entities inserted/fetched/modified: 20/second
[INFO ] Batch Size: 10
[INFO ] Opening database: bulkloader-progress-20111001.122234.sql3
[INFO ] Opening database: bulkloader-results-20111001.122234.sql3
[INFO ] Connecting to montaoproject.appspot.com/remote_api
Please enter login credentials for montaoproject.appspot.com
Email: niklasro
Password for niklasro:
[INFO ] Authentication Failed
app.yaml:
- url: /remote_api
script: remote_api.py
remote_api.py:
from google.appengine.ext.remote_api import handler
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import re
MY_SECRET_KEY = 'thetopsecret'
cookie_re = re.compile('^"([^:]+):.*"$')
class ApiCallHandler(handler.ApiCallHandler):
def CheckIsAdmin(self):
login_cookie = self.request.cookies.get('dev_appserver_login', '')
match = cookie_re.search(login_cookie)
if (match and match.group(1) == MY_SECRET_KEY
and 'X-appcfg-api-version' in self.request.headers):
return True
else:
self.redirect('/_ah/login')
return False
application = webapp.WSGIApplication([('.*', ApiCallHandler)])
def main():
run_wsgi_app(application)
if __name__ == '__main__':
main()
Обновление
Состояние сервера 302, а метод в remote_api.py
не достигнут:
2011-11-08 09:02:40.214 /remote_api?rtok=935015419683 302 12ms 0kb
213.89.134.0 - - [08/Nov/2011:03:02:40 -0800] "GET /remote_api?rtok=935015419683 HTTP/1.1" 302 0 - - "montaoproject.appspot.com" ms=13 cpu_ms=0 api_cpu_ms=0 cpm_usd=0.000026