我正在使用反向代理在自定义域上启用ssl.代理在公共页面上正常工作,但是当用户尝试访问login_required目录时,登录URL会在登录后将其转移到我的appspot域.
有没有办法让用户保持自定义域名?
这是我的登录处理程序:
class OpenIDLoginHandler(webapp.RequestHandler):
def get(self):
domain = self.request.get('domain')
continue_url = self.request.GET.get('continue')
if not continue_url:
continue_url = 'https://my_domain/login_required_directory/'
if domain:
self.redirect(users.create_login_url(dest_url=continue_url,
_auth_domain=None,federated_identity=domain))
else:
login_url = users.create_login_url(dest_url=continue_url,
federated_identity='https://www.google.com/accounts/o8/id')
self.redirect(login_url)
application = webapp.WSGIApplication(
[
('/_ah/login_required', OpenIDLoginHandler)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
Run Code Online (Sandbox Code Playgroud)
我已经尝试在users.create_login_url调用中覆盖目标url - 该函数仍然返回一个login_url,其中appspot域为'continue'参数,如下所示:
"https://开头appspot_domain/_ah/login_redir ClaimID的= HTTPS:?//www.google.com/accounts/o8/id&continue=https:// appspot_domain"
我尝试简单地重写返回的login_url并将'continue'参数替换为我的自定义域,但这导致404错误.
有什么想法吗?
提前致谢!
目前正在研究 Xamarin.Mac 解决方案,该解决方案由于两个引用的项目缺少“[projectName].dll.mdb”(单声道调试符号)文件而突然无法构建。
这些不是由 Xamarin Studio 自动生成的吗?有没有办法手动生成这些文件?任何帮助,将不胜感激。
我正在将应用程序从Python 2.5切换到2.7并且已经开始遇到图像服务的问题.例如,使用db.put()保存此实体:
from google.appengine.api import images
class Images(db.Expando):
ImageTitle = db.StringProperty()
ImageFile = blobstore.BlobReferenceProperty()
ImageReference = db.StringProperty()
def put(self, **kwargs):
if not self.ImageReference:
self.ImageReference = images.get_serving_url(self.ImageFile.key())
super(Images, self).put(**kwargs)
Run Code Online (Sandbox Code Playgroud)
现在产生这个错误:
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1536, in __call__
rv = self.handle_exception(request, response, e)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1530, in __call__
rv = self.router.dispatch(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1102, in __call__
return handler.dispatch() …Run Code Online (Sandbox Code Playgroud)