很抱歉,我在应用程序引擎 python 项目中实现 Oauth 时遇到了一些问题。
我一直在 http://github.com/tav/tweetapp 工作,但我不我不认为我对这个平台有足够的掌握,可以理解如何在我的 main.py 中实现这个类,我正在构建我的应用程序的其余部分。
到目前为止所拥有的:
twa = twitter_auth
client = twa.OAuthClient('twitter')
这可能是一个微弱的尝试,但这是我 在我的项目中创建了一个名为“twitter_auth”的源文件夹,其中包含一个名为“twitter_auth.py”的文件,其中包含上述链接库,以及一个名为 __ init__.py (无空格)的文件,该文件完全是空的。
我真的不知道从这里做什么:/
I'm sorry but I'm having some trouble implementing Oauth within my app engine python project.
I've been working from http://github.com/tav/tweetapp, but I don't think I have a strong enough grasp on this platform to understand how to implement this class within my main.py I'm building the rest of my app in.
This maybe a feeble attempt, but here is what I have so far:
twa = twitter_auth
client = twa.OAuthClient('twitter')
I've created a source folder within my project called "twitter_auth" and that contains a file within it called "twitter_auth.py" which contains the above linked library, and a file called __ init__.py (no space) which is completely empty.
I really have no idea what to do from here :/
发布评论
评论(4)
我建议您查看 tweepy 库和一些示例 tweepy 应用程序。具体在这里: http://github.com/wasauce/tweepy-examples
这展示了如何使用 oauth 对用户进行身份验证: http://github.com/ wasauce/tweepy-examples/tree/master/appengine/oauth_example/
Let me recommend taking a look at the tweepy library and some example tweepy apps. Specifically here: http://github.com/wasauce/tweepy-examples
This shows how to use oauth to authenticate a user: http://github.com/wasauce/tweepy-examples/tree/master/appengine/oauth_example/
正如 Hagge 所说,听起来您的问题更多地与 tweetapp 库有关,而不是与 App Engine 有关。但是,如果您想了解有关 App Engine 上的 OAuth 的更多信息,并且可以允许我链接到我自己,我的 两个 有关该主题的文章似乎相当受欢迎。
As Hagge said, it sounds like your issue is more with the tweetapp library than with App Engine. However, if you would like to know more about OAuth on App Engine and if I may be allowed to link to myself, my two articles on the topic seem to be reasonably popular.
tweetapp 库是 Twitter 上 Twitter OAuth 的早期原型。 Tav 完成了繁重的工作,我部署了网站 http://twitteroauth.appspot.com ,使用了一些tweetapp 库。该网站的实际来源在这里(我需要更新该网站以指向此处):http://github。 com/ryanwi/twitteroauth
我仍在生产中使用它,但是,它已经老化并且不适用于所有 API 调用。我建议尝试一个不同的、更新的和维护的库,正如其他人提到的那样。
但是,如果您想尝试第一次尝试,请查看 twitteroauth 源代码。
这两个在 Twitter 的列表中
The tweetapp library was a an early prototype for Twitter OAuth on twitter. Tav did the heavy lifting and I deployed the site http://twitteroauth.appspot.com , using some of the tweetapp library. The actual source of that site is here (I need to update the site to point here): http://github.com/ryanwi/twitteroauth
I am still using it in production, but, it has aged and does not work for all API calls. I'd recommend trying a different, more up to date and maintained library as others have mentioned.
But, take a look at the twitteroauth source if you want to try to get a first attempt working.
These two are on Twitter's list
我不熟悉该库,但快速浏览并看到该库未维护的警告后,我会寻找更好的库。我基于 Tornado 的身份验证实现了一个简单的 Twitter 连接:请参阅如何进行 Twitter API 调用的示例 此处(以及身份验证示例此处)。如果您不想使用tipfy,我建议您实现python-twitter 您选择的框架中的库。
I'm not familiar with that library, but after a quick look and seeing the warning that it is not maintained I'd search for something better. I implemented a simple Twitter connection based on Tornado's auth: see an example of how to make Twitter API calls here (and an authentication example here). In case you don't want to use tipfy, I recommend implementing the python-twitter library in your framework of choice.