使用Django / Python为Facebook应用程序创建一个Like-Gate(显示选项卡) [英] Creating a Like-Gate (reveal tab) for a Facebook app, using Django/Python

查看:115
本文介绍了使用Django / Python为Facebook应用程序创建一个Like-Gate(显示选项卡)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Python / Django构建一个Facebook应用程序。我已经安装了FanDjango,这很好用。我只需要一件事。



我想为应用程序建立一个喜欢门。我希望应用程序检测用户是否喜欢粉丝页面,然后才能查看其大部分内容。我还没有找到一个很好的解决方案。



我很在意使用像PyFacebook这样的东西。有人可以建议一个好的选择吗?谢谢。

解决方案

Fandjango包裹脸庞,这实际上更容易。仅通过pip安装Fandjango以避免冲突。



在请求对象的视图中,您可以简单地检查

  request.facebook.signed_request.page.is_liked 

并执行不同的操作。请记住,如果应用程序不在页面中,该页面将为无。


I'm building a Facebook app using Python/Django. I've installed FanDjango and that works great. Just one more thing I need.

I'd like to build a "like-gate" for the app. I'd like the app to detect whether the user has "liked" a Fan page before they can view the bulk of it. I haven't found a good solution for that yet.

I'm wary of using something like PyFacebook. Can someone suggest a good option? Thanks.

解决方案

Fandjango wraps facepy so it's actually easier. Install only Fandjango via pip to avoid conflicts.

In the view with the request object, you can simply check against

request.facebook.signed_request.page.is_liked

and perform different actions. Remember that page will be None if the app is not in a page.

这篇关于使用Django / Python为Facebook应用程序创建一个Like-Gate(显示选项卡)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆