0

我正在 Google App Engine 上部署一个 django-nonrel 应用程序。该应用程序部署正常,但我无法登录远程外壳。

这是我的 app.yaml 文件:

application: masnun
version: 1
runtime: python
api_version: 1

builtins:
- remote_api: on

inbound_services:
- warmup

handlers:
- url: /_ah/queue/deferred
  script: djangoappengine/deferred/handler.py
  login: admin

- url: /media/admin
  static_dir: django/contrib/admin/media
  expiration: '0'

- url: /.*
  script: djangoappengine/main/main.py

但我收到一个错误:

urllib2.URLError: <urlopen error HTTP Error 500: Internal Server Error
Couldn't reach remote_api handler at https://masnun.appspot.com/_ah/remote_api(/.*)?.
Make sure you've deployed your project and installed a remote_api handler in app.yaml.>

请帮帮我!

更新:使用 Python2.5 时,出现此错误:

DEBUG:google.appengine.tools.appengine_rpc:Got http error, this is try #3
DEBUG:google.appengine.tools.appengine_rpc:Sending HTTPS request:
GET /_ah/remote_api(/.*)? HTTPS/1.1
Host: masnun.appspot.com
X-appcfg-api-version: 1
Content-type: application/octet-stream
User-agent: Google-remote_api/1.0 Linux/2.6.35-25-generic Python/2.5.5.final.0
4

3 回答 3

2

将此添加到 app.yaml 部分处理程序中,第一项:

处理程序:
- 网址:/remote_api
  脚本:$PYTHON_LIB/google/appengine/ext/remote_api/handler.py
  登录:管理员

并再次部署。

于 2011-04-16T03:22:05.457 回答
1

问题在于

获取 /_ah/remote_api(/.*)?HTTPS/1.1

如果您注意到,URL 包含无效字符“(/.*)?” 接近尾声。

假设您使用的是 django-nonrel,这很容易解决。打开文件

djangoappengine/db/base.py

并更改线路

self.remote_api_path = handler.url

self.remote_api_path = handler.url.split('(')[0] # remove '(/.*)' introduced in newer GAE

并且应该注意确保 URL 是正确的。

于 2012-05-10T11:58:12.620 回答
0

您可以使用连接到远程外壳

python manage.py remote shell

并且仅当您使用 Google 帐户身份验证创建 App Engine 应用时。但是 remote_api 需要一个已部署的应用程序,并且由于您的

python manage.py deploy

失败,上述错误是正常的。

尝试部署时遇到什么错误?

于 2011-04-13T23:38:49.803 回答