当我尝试在本地主机中探索我的 python GAE 后端时,什么也没有出现,当我查看日志时,出现的是:
2013-09-17 20:27:03 Running command: "['C:\\Python27\\python.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000', 'C:\\Users\\Renzo\\Desktop\\engineapp']"
INFO 2013-09-17 20:27:06,841 devappserver2.py:557] Skipping SDK update check.
WARNING 2013-09-17 20:27:06,858 api_server.py:327] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2013-09-17 20:27:32,516 module.py:593] default: "GET / HTTP/1.1" 404 -
INFO 2013-09-17 20:27:41,940 module.py:593] default: "GET /_ah/api/explorer HTTP/1.1" 302 -
INFO 2013-09-17 20:27:45,551 module.py:593] default: "GET /_ah/api/static/proxy.html?jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.es.TB94DdVNa4o.O%2Fm%3D__features__%2Fam%3DAQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTONERRh8JkOutwE4dX0rKeVJfEYmg HTTP/1.1" 200 1933
ERROR 2013-09-17 23:27:45,628 wsgi.py:262]
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 239, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 298, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 84, in LoadObject
obj = __import__(path[0])
File "C:\Users\Renzo\Desktop\engineapp\backend.py", line 34
entity.contrasenia=""
^
IndentationError: unexpected indent
INFO 2013-09-17 20:27:45,638 module.py:593] default: "POST /_ah/spi/BackendService.getApiConfigs HTTP/1.1" 500 -
INFO 2013-09-17 20:27:45,638 module.py:593] default: "GET /_ah/api/discovery/v1/apis HTTP/1.1" 500 60
这是代码....
from google.appengine.ext import ndb
from google.appengine.ext import endpoints
from model_usuario import *
from protorpc import remote
from model_usuario import *
@endpoints.api(name='Usuario', version='v1', description='')
class Usuario(remote.Service):
"""Clase Usuario v1"""
@endpoints.method(LoginRequest, LoginResponse, path='acceso', http_method='POST', name='acceso.login')
def login(self, request):
if(request.nombre is None):
request.nombre=""
Key=db.Key.from_path('Usuario', request.nombre)
usrSearch=db.get(key)
entity=LoginResponse()
if(usrSearch is None):
entity.nombre="error"
entity.contrasenia=""
return entity
else:
entity.nombre="ok"
"""entity.contrasenia="ok"""
if(request.contrasenia==usrSerach.contrasenia):
entity.contrasenia="ok"
else:
entity.contrasenia="error"
return entity
我希望有一个人可以帮助我!