- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我尝试将主页 '/'
设置为用户登录或不登录,但我得到了一个NotAllowedError
。这适用于本地服务器。但是,在真正的公用服务器中似乎不起作用。
NotAllowedError
是否意味着遵守 Google App Engine 标准,即不在首页上放置登录信息或其他内容?
这里是错误:
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
rv = self.handle_exception(request, response, e)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
return handler.dispatch()
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "/base/data/home/apps/s~map-jobs/2.371277816538602179/main.py", line 294, in get
user_url = users.create_login_url() # raise NotAllowedError
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/users.py", line 256, in create_login_url
raise NotAllowedError
NotAllowedError
这是我的 MainHandler
:
class MainHandler(BaseHandler):
def get(self):
user = users.get_current_user()
logout_url = users.create_logout_url(self.request.uri)
profile=''
if user:
profile = Profile.query(Profile.user_id==user.user_id())
if profile.count() <= 0:
profile = Profile()
profile.user_id = user.user_id()
profile.email = user.email()
profile.firstname = user.nickname()
profile_key = profile.put()
else:
profile_key = Profile.query(Profile.user_id==user.user_id())
profile = profile_key.get()
current_user = 'Hello, '+ user.nickname()
user_url = logout_url
title = "Click to logout from Google."
else:
current_user = 'Google Sign in'
user_url = users.create_login_url(self.request.uri) # raise NotAllowedError
title = "Click to sign in with your Google Account."
values = {
'current_user' : current_user,
'user_url' : user_url,
'profile' : profile,
}
self.render_html('index.html',values)
这是我的 webapp2.WSGIApplication
的一部分:
app = webapp2.WSGIApplication([
('/', MainHandler),
], debug=True)
这是我的 app.yaml:
application: map-jobs
version: 2
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /(.*\.(gif|png|jpg|js|css|woff|ttf|svg))
static_files: static/\1
upload: static/(.*\.(gif|png|jpg|js|css|woff|ttf|svg))
- url: /templates/.*
script: templates.app
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
- name: jinja2
version: "2.6"
最佳答案
没关系,我只是犯了一个错误。我应该在我的应用程序设置中使用 Google Accounts API 而不是 Google Apps Domain。
关于function - 主页面上的 NotAllowedError '/',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19676367/
更新3 无奈之下,我创建了一个新的google appengine应用,该应用与原始应用相同,即使名称相同,但ID稍长。新应用程序具有-232619 added to the ID,原始应用程序具有简
我正在使用 ar.js,它使用用户网络摄像头并发出权限提示。我想要的是在用户允许或拒绝访问网络摄像头或之前已经这样做的情况下收听此对话触发的全局事件。 我试过像这样的全局听众: document.d
我突然得到一个 navigator.MediaDevices.getUserMedia notAllowedError 我不是一个月前。没有代码改变。我正在使用火狐 68.01。当我在 AWS 上运行
我尝试将主页 '/' 设置为用户登录或不登录,但我得到了一个NotAllowedError。这适用于本地服务器。但是,在真正的公用服务器中似乎不起作用。 NotAllowedError 是否意味着遵守
我们正在尝试制作视频 session 应用程序。在 Windows 上运行该应用程序进行测试时,视频打开得很好,但是当我们在物理设备(Android 手机)上运行它时,出现以下错误并且视频不显示。 E
我有一个简短的问题。当我按下一个使用 ajax 请求将数据获取到剪贴板的按钮时,我想在我的 iOS 设备上的剪贴板上添加一个文本。 使用我桌面上的浏览器和我的 Android 设备,它运行良好,但使用
我有一个带有按钮的简单页面,按下该按钮时,它使用异步剪贴板 API 写入剪贴板。 Test Clipboard function testClipboard() { nav
自上次 Safari 更新到版本 11 以来,一些视频停止播放。最糟糕的是,有时,就像五次尝试中一次,它会奏效。我认为原因是我的 JS 脚本集成了 Vimeo Player API,但结果是 Vime
我有一个正在制作的网站,这是一个非常旧的网站,我对彻底改造不感兴趣。 我有一个 Controller ,可以从 soundcloud 播放列表中获取一堆轨道,以及一些循环播放它们的代码
我有一个套件可以记录用户的网络摄像头和麦克风。它在网页上运行良好,但在 Chrome 扩展程序中: navigator.mediaDevices.getUserMedia({video: true,
基于 How-to guide 中的示例代码,我在 Google App Engine 中使用 users.create_login_url 的一个非常基本的示例遇到了问题。 .该示例在本地开发服务器
我的问题的沙盒演示:https://codesandbox.io/s/jolly-fermat-j23w9 我正在尝试在我的 React 网站上实现一个功能,用户点击一个元素,然后播放音频。 在桌面上
我有一个简单的页面,其中包含我通过 AJAX 请求处理的一些详细信息。 在 AJAX 调用成功回调时,我试图触发 navigator.share这给了我一个错误: NotAllowedError: M
我正在尝试开发一个 Chrome 扩展来访问网络摄像头并录制视频,并在停止后下载它。 扩展失败,调用以下代码行时出错: navigator.mediaDevices.getUserMedia({ au
客观化。预期行为:按下复制按钮后,文本将复制到手机剪贴板中。当前行为:按下复制按钮后,Ffltter InAppWebView抛出错误未捕获(在Promise中)NotAlledError:写入权限被
我是一名优秀的程序员,十分优秀!