草庐IT

register-account

全部标签

python - 使用 Python 3.4 的服务器到服务器应用程序的 OAuth 2.0,无法导入名称 'SERVICE_ACCOUNT'

我正在尝试在我的Python3.4应用程序中实现“服务器到服务器”OAuth身份验证以与Google云存储一起使用。所以,一般来说,这个页面上描述了UsingOAuth2.0forServertoServerApplications但是当我运行我的脚本时出现错误:Traceback(mostrecentcalllast):File"my_script.py",line4,infromoauth2client.service_accountimportServiceAccountCredentialsFile"/usr/local/lib/python3.4/dist-packages/

python - Django 1.9 到 1.10 引发 NoReverseMatch : u'en-gb' is not a registered namespace

我正在尝试将我的1.9应用程序更新到1.10,但在运行所有单元测试时出现以下错误:Traceback(mostrecentcalllast):File"/home/…/tests/views/test_configurator.py",line261,intest_view_configurator_postargs=[self.configurator.id]),File"/home/…/.virtualenvs/intranet/lib/python2.7/site-packages/django/urls/base.py",line87,inreverseraiseNoRever

python - ServerNotFoundError : Unable to find the server at accounts. google.com

我正在使用基于以下示例的google身份验证。一切正常,然后当我尝试登录时突然出现此错误:httplib2.ServerNotFoundErrorServerNotFoundError:Unabletofindtheserverataccounts.google.com有什么地方可能是错的吗?fromflaskimportFlask,redirect,url_for,sessionfromflask_oauthimportOAuth#Youmustconfigurethese3valuesfromGoogleAPIsconsole#https://code.google.com/api

python - 关系 "account_emailaddress"不存在 - Django 错误

我正在按照本教程将社交媒体登录集成到我的django项目中-http://www.sarahhagstrom.com/2013/09/the-missing-django-allauth-tutorial/但是在完成所有步骤后,当我尝试使用facebook登录时,出现此错误relation"account_emailaddress"doesnotexist我不明白哪里出了问题,因为所有数据库修改都正常运行,没有错误。预先感谢您提供宝贵的答案。堆栈跟踪Environment:RequestMethod:POSTRequestURL:example.com/accounts/faceboo

python - Django admin.site.register 不添加我的应用程序管理员

作为一个django新手(我对其他pythonwebframework有一些经验,比如turbogears和bottle但正在探索django)我正在尝试为我的应用程序模型自动创建管理在主URLS.py中我有:编辑:fromdjango.contribimportadminadmin.autodiscover()之后:urlpatterns=patterns('',url(r'^appname/',include('appname.urls')),url(r'^admin/',include(admin.site.urls))注意这是在主urls.py中而不是在应用程序urls.py中

python - ('Unexpected credentials type',无, 'Expected', 'service_account')与 oauth2client(Python)

我正在尝试通过本指南获取GoogleAnalytics数据:https://ga-dev-tools.appspot.com/embed-api/server-side-authorization/defget_access_token(request):return{'access_t':ServiceAccountCredentials.from_json_keyfile_name(KEY_FILEPATH,SCOPE).get_access_token().access_token}使用上面的代码,我尝试创建一个函数并将访问token返回到我的管理模板中的上下文。但是。我收到此错

Python Django 自定义模板标签 register.assignment_tag 不工作

这是我的PythonDjango自定义模板标签代码fromdjangoimporttemplatefromipc.declarations.modelsimportMainDeclarationfromdjango.shortcutsimportget_object_or_404register=template.Library()defsection_settings(declarationId,user):declaration=get_object_or_404(MainDeclaration,pk=declarationId,user=user)businessInfo=dec

python - GSpread 导入错误 : No module named oauth2client. service_account

好的,我正在学习“成为一名技术营销人员”类(class),我正在尝试学习如何使用GSpread管理Google电子表格。我遵循了http://gspread.readthedocs.io/en/latest/oauth2.html中的文档.我已按照上面第二个URL中的步骤操作,并使用以下代码运行了一个文档:importgspreadfromoauth2client.service_accountimportServiceAccountCredentialsscope=['https://spreadsheets.google.com/feeds']credentials=Service

python - 获取错误 : redirect_uri_mismatch The redirect URI in the request: http://localhost:8080/oauth2callback did not match a registered redirect URI

我在尝试运行我的应用程序时遇到此错误...TheredirectURIintherequest:http://localhost:8080/oauth2callbackdidnotmatcharegisteredredirectURI在googleAPI控制台中我已经注册了我的重定向urlRedirectURIs:http://localhost:8080/并且在client_secrets.json中我也使用与重定向url相同的内容我正在关注本教程https://developers.google.com/bigquery/articles/dashboard#addoauth2编辑

python - Flask-Security user_registered 信号在 Python 3.3 中未收到,但在 2.7 中有效

我正在尝试使用user_registered信号,以便在用户使用flask-security注册时为用户设置默认角色,如下链接所示:SettingDefaultRoleinFlaskSecurity在我的搜索中,我可以看到flask-security中已经解决了一个错误:Notgettingsignalfromflask-security,Fix-user_registeredsignalproblem我已经尝试了以下方法来证明信号是否被处理程序接收到,但没有任何运气:@user_registered.connect_via(app)defuser_registered_sighand