Skip to content
This repository has been archived by the owner on Nov 23, 2020. It is now read-only.

Nochmals #19

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
11491da
add insight link to page
Mar 8, 2012
65b9455
add batch request to graph, new pagepost intermediate model. Small fixes
Mar 12, 2012
8b77305
fix in feincms views, add helper in posts
Mar 15, 2012
b5a6926
add expires in for page access token
Mar 16, 2012
253cf60
add access token expires in field and adjusted admin
Mar 16, 2012
1836864
fix in feincms middleware
Apr 3, 2012
bff1e47
add insight link to page
Mar 8, 2012
82db93e
add batch request to graph, new pagepost intermediate model. Small fixes
Mar 12, 2012
40be623
fix in feincms views, add helper in posts
Mar 15, 2012
b8c8f8a
add expires in for page access token
Mar 16, 2012
e88ebba
add access token expires in field and adjusted admin
Mar 16, 2012
3231fe2
update in docs
Apr 11, 2012
39de118
Merge branch 'structured' of github.com:sbaechler/django-facebook-gra…
Apr 11, 2012
057f4c8
uncomment post_throughs due to compatibility issues
Apr 11, 2012
6a106eb
optionally add generic related object
Apr 13, 2012
531bb48
update in deauthorization callback. With preview!
Apr 13, 2012
d225c51
modification for deauthorize callback
Apr 13, 2012
cd2efb8
Merge branch 'structured' of github.com:sbaechler/django-facebook-gra…
Apr 13, 2012
44a8379
add insight link to page
Mar 8, 2012
18973e9
add batch request to graph, new pagepost intermediate model. Small fixes
Mar 12, 2012
dca3ede
fix in feincms views, add helper in posts
Mar 15, 2012
51566fd
add expires in for page access token
Mar 16, 2012
c2222e2
add access token expires in field and adjusted admin
Mar 16, 2012
8b2fa71
update user profile fields
sbaechler Mar 18, 2012
602af0d
add milestones
sbaechler Mar 18, 2012
ef8022b
add insight link to page
Mar 8, 2012
7c5380a
add batch request to graph, new pagepost intermediate model. Small fixes
Mar 12, 2012
b2669b6
fix in feincms views, add helper in posts
Mar 15, 2012
ffb7bee
add expires in for page access token
Mar 16, 2012
04e0cd1
add access token expires in field and adjusted admin
Mar 16, 2012
7cd9d5d
update in docs
Apr 11, 2012
8c1ce1c
uncomment post_throughs due to compatibility issues
Apr 11, 2012
df555fa
optionally add generic related object
Apr 13, 2012
a397249
update in deauthorization callback. With preview!
Apr 13, 2012
e585f67
modification for deauthorize callback
Apr 13, 2012
943273b
cleanup in views
sbaechler May 19, 2012
6fe59dd
Merge branch 'structured' of github.com:sbaechler/django-facebook-gra…
sbaechler May 19, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/installation.rst
Expand Up @@ -54,7 +54,7 @@ entry for every app in your project. It is recommended to use different app
'CANVAS-PAGE': 'https://apps.facebook.com/yourapp', 'CANVAS-PAGE': 'https://apps.facebook.com/yourapp',
'CANVAS-URL': '', 'CANVAS-URL': '',
'SECURE-CANVAS-URL': '', 'SECURE-CANVAS-URL': '',
'REDIRECT-URL': '', 'REDIRECT-URL': 'mydomain.com/facebook/redirect/?next=%2F%2Fwww.facebook.com%2Fpages%2F',
'DOMAIN' : 'localhost.local:8000', 'DOMAIN' : 'localhost.local:8000',
'NAMESPACE': 'mynamespace', 'NAMESPACE': 'mynamespace',
} }
Expand All @@ -75,7 +75,7 @@ Add this to the header section of your base template::
{% load fb_tags %} {% load fb_tags %}
<script type="text/javascript"> <script type="text/javascript">
FACEBOOK_APP_ID = '{% fb_app_id %}'; FACEBOOK_APP_ID = '{% fb_app_id %}';
FACEBOOK_REDIRECT_URL = '{% fb_redirect_url %}'; FACEBOOK_REDIRECT_URL = document.location.protocol + '//' + '{% fb_redirect_url %}';
FACEBOOK_CHANNEL_URL = '{% url channel %}'; FACEBOOK_CHANNEL_URL = '{% url channel %}';
FACEBOOK_APP_NAMESPACE = '{% fb_app_namespace %}'; // needed for og actions. FACEBOOK_APP_NAMESPACE = '{% fb_app_namespace %}'; // needed for og actions.
</script> </script>
Expand All @@ -87,7 +87,7 @@ Facebook applications in one installation::
{% load fb_tags %} {% load fb_tags %}
<script type="text/javascript"> <script type="text/javascript">
FACEBOOK_APP_ID = '{% fb_app_id feincms_page.facebook_application %}'; FACEBOOK_APP_ID = '{% fb_app_id feincms_page.facebook_application %}';
FACEBOOK_REDIRECT_URL = '{% fb_redirect_url feincms_page.facebook_application %}'; FACEBOOK_REDIRECT_URL = document.location.protocol + '//' + '{% fb_redirect_url feincms_page.facebook_application %}';
FACEBOOK_CHANNEL_URL = '{% url channel %}'; FACEBOOK_CHANNEL_URL = '{% url channel %}';
</script> </script>
<script type="text/javascript" src="{{ STATIC_URL }}facebook/fb_utils.js"></script> <script type="text/javascript" src="{{ STATIC_URL }}facebook/fb_utils.js"></script>
Expand Down
22 changes: 22 additions & 0 deletions docs/reference.rst
Expand Up @@ -8,3 +8,25 @@ Django-facebook-graph reference
installation installation
clientside clientside



Deauthorization callback
------------------------

There is a default url that can be called for the deauthorization callback::

http://<canvas url>/facebook/deauthorize/<app name>/

The app name parameter is optional but needed if you have multiple apps to
decrypt the signed request. The default action is to delete the user model and
all related entries.


Testing the deauthorization callback
------------------------------------

If you are logged in to django you can test the deauthorization callback by calling this url::

http://localhost.local:8000/facebook/deauthorize/<app name>/?userid=<user_id>

You will be shown a page like the one in the django admin
that shows you which entries would be deleted on a deauthorization callback.
3 changes: 3 additions & 0 deletions facebook/feincms/middleware.py
Expand Up @@ -9,6 +9,9 @@ class PreventForeignApp(object):
associated page """ associated page """


def process_request(self, request): def process_request(self, request):
if 'deauthorize' in request.path:
return None

if 'facebook' in request.session and 'signed_request' in request.session['facebook']: if 'facebook' in request.session and 'signed_request' in request.session['facebook']:
facebook_page = get_page_from_request(request) facebook_page = get_page_from_request(request)
signed_request = request.session['facebook']['signed_request'] signed_request = request.session['facebook']['signed_request']
Expand Down
8 changes: 5 additions & 3 deletions facebook/feincms/views.py
@@ -1,4 +1,5 @@
from django.conf import settings from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import redirect from django.shortcuts import redirect


from feincms.module.page.models import Page from feincms.module.page.models import Page
Expand All @@ -9,8 +10,9 @@ def redirect_to_slug(request):


try: try:
facebook_page = request.session['facebook']['signed_request']['page'] facebook_page = request.session['facebook']['signed_request']['page']
except e: except KeyError as e:
return '<!-- could not redirect to slug via facebook page signed request params: %s -->' % e return HttpResponse('<!-- could not redirect to slug via facebook page signed request params: %s -->' % e)



page = Page.objects.from_request(request, best_match=True) page = Page.objects.from_request(request, best_match=True)
if facebook_page['admin'] and facebook_page['liked']: if facebook_page['admin'] and facebook_page['liked']:
Expand All @@ -32,4 +34,4 @@ def redirect_to_slug(request):
try: try:
return redirect(page.get_children().filter(slug='unliked')[0]) return redirect(page.get_children().filter(slug='unliked')[0])
except IndexError: except IndexError:
return '<!-- no childpage with matching slug found. looked for slugs: admin-liked, liked, admin, unliked -->' return HttpResponse('<!-- no childpage with matching slug found. looked for slugs: admin-liked, liked, admin, unliked -->')
12 changes: 11 additions & 1 deletion facebook/graph.py
Expand Up @@ -84,9 +84,19 @@ def get_objects(self, ids, **args):
return self.request("", args) return self.request("", args)


def get_connections(self, id, connection_name, **args): def get_connections(self, id, connection_name, **args):
"""Fetchs the connections for given object.""" """Fetches the connections for given object."""
return self.request(id + "/" + connection_name, args) return self.request(id + "/" + connection_name, args)


def batch_request(self, batch):
""" Combines multiple requests into one.
Batch must be a List of Dicts in the format:
[{"method": "GET", "relative_url": "me"},
{"method": "GET", "relative_url": "me/friends?limit=50"}]
It returns a list of response dicts:
http://developers.facebook.com/docs/reference/api/batch/
"""
return self.request('', None, {'batch': json.dumps(batch)})

def put_object(self, parent_object, connection_name, **data): def put_object(self, parent_object, connection_name, **data):
"""Writes the given object to the graph, connected to the given parent. """Writes the given object to the graph, connected to the given parent.


Expand Down
4 changes: 4 additions & 0 deletions facebook/middleware.py
Expand Up @@ -31,6 +31,10 @@ def process_request(self, request):


logger.debug('Request Method = %s\n, AccessToken=%s' % (request.method, fb.access_token)) logger.debug('Request Method = %s\n, AccessToken=%s' % (request.method, fb.access_token))


if 'deauthorize' in request.path:
logger.debug('deauthorize call, SignedRequestMiddleware returning...')
return None

if 'feincms' in settings.INSTALLED_APPS: if 'feincms' in settings.INSTALLED_APPS:
# if feincms is installed, try to get the application from the page # if feincms is installed, try to get the application from the page
from facebook.feincms.utils import get_application_from_request from facebook.feincms.utils import get_application_from_request
Expand Down
7 changes: 5 additions & 2 deletions facebook/modules/base.py
Expand Up @@ -120,6 +120,9 @@ def to_django(self, response, graph=None, save_related=True):
obj.get_from_facebook(graph=graph, save=True) obj.get_from_facebook(graph=graph, save=True)
elif created and not save_related and 'name' in val: elif created and not save_related and 'name' in val:
obj._name = val['name'] obj._name = val['name']
elif not created and 'name' in val:
# make sure name is defined:
obj._name = val['name']
elif isinstance(fieldclass, models.DateField): elif isinstance(fieldclass, models.DateField):
# Check for Birthday: # Check for Birthday:
setattr(self, field, datetime.strptime(val, "%m/%d/%Y").date()) setattr(self, field, datetime.strptime(val, "%m/%d/%Y").date())
Expand All @@ -133,8 +136,8 @@ def to_django(self, response, graph=None, save_related=True):
setattr(self, '_%s_id' % prop, val['id']) setattr(self, '_%s_id' % prop, val['id'])




def save_from_facebook(self, response, update_slug=False, save_related=True): def save_from_facebook(self, response, update_slug=False, save_related=True, graph=None):
self.to_django(response, save_related) self.to_django(response, graph=graph, save_related=save_related)
if update_slug or not self.slug: if update_slug or not self.slug:
self.generate_slug() self.generate_slug()
self.save() self.save()
Expand Down
Empty file.
26 changes: 26 additions & 0 deletions facebook/modules/connections/milestone/models.py
@@ -0,0 +1,26 @@
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from facebook.modules.base import Base

class Milestone(Base):
id = models.BigIntegerField(primary_key=True)
# from is a Generic FK to User or Page.
_from = generic.GenericForeignKey('__profile_type', '__profile_id')
__profile_id = models.BigIntegerField()
__profile_type = models.ForeignKey(ContentType)
_created_time = models.DateTimeField(blank=True, null=True)
_updated_time = models.DateTimeField(blank=True, null=True)
_start_time = models.DateTimeField(blank=True, null=True)
_end_time = models.DateTimeField(blank=True, null=True)
_title = models.CharField(max_lenght=255, blank=True, null=True)
_description = models.TextField()

class Meta:
ordering = ['-_start_time']
get_latest_by = '_start_time'
verbose_name = _('Milestone')
verbose_name_plural = _('Milestones')

def __unicode__(self):
return self.title
4 changes: 4 additions & 0 deletions facebook/modules/connections/post/admin.py
@@ -1,5 +1,8 @@
from django.contrib.admin.options import InlineModelAdmin
from facebook.modules.base import AdminBase from facebook.modules.base import AdminBase


from django.contrib.contenttypes.models import ContentType

class PostAdmin(AdminBase): class PostAdmin(AdminBase):
def picture_link(self, obj): def picture_link(self, obj):
return '<img src="%s" />' % (obj._picture) return '<img src="%s" />' % (obj._picture)
Expand All @@ -17,3 +20,4 @@ def icon_link(self, obj):
'_properties', '_actions', '_privacy', '_likes', '_comments', '_targeting') '_properties', '_actions', '_privacy', '_likes', '_comments', '_targeting')
date_hierarchy = '_updated_time' date_hierarchy = '_updated_time'
list_filter = ('_type',) list_filter = ('_type',)

23 changes: 22 additions & 1 deletion facebook/modules/connections/post/models.py
@@ -1,5 +1,7 @@
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic


from facebook.fields import JSONField from facebook.fields import JSONField
from facebook.modules.base import Base from facebook.modules.base import Base
Expand Down Expand Up @@ -55,7 +57,7 @@ class Facebook:




def __unicode__(self): def __unicode__(self):
return u'%s, %s %s' % (self.id, self._message[:50], self._picture) return u'%s, %s' % (self.id, self._message[:50])


# Deal with changes from Facebook # Deal with changes from Facebook
@property @property
Expand All @@ -70,6 +72,8 @@ def _subject(self):


# Note has no type attribute. # Note has no type attribute.
def guess_type(self): def guess_type(self):
if self._type:
return self._type
if self._subject: if self._subject:
self._type = 'note' self._type = 'note'
elif self._story and self._picture: elif self._story and self._picture:
Expand Down Expand Up @@ -126,9 +130,26 @@ def status(self):




class Post(PostBase): class Post(PostBase):

class Meta(PostBase.Meta): class Meta(PostBase.Meta):
app_label = 'facebook' app_label = 'facebook'
verbose_name = _('Post') verbose_name = _('Post')
verbose_name_plural = _('Posts') verbose_name_plural = _('Posts')
abstract = False abstract = False



class PagePost(models.Model):
""" This is a generic intermediate model to attach posts to Pages or Profiles
"""
post = models.ForeignKey(Post)
content_type = models.ForeignKey(ContentType)
object_id = models.BigIntegerField()
to = generic.GenericForeignKey()
created = models.DateTimeField(auto_now_add=True)

class Meta:
app_label = 'facebook'
unique_together = (('post', 'content_type', 'object_id'),)

def __unicode__(self):
return u'%s to %s' % (self.post, self.to)
11 changes: 9 additions & 2 deletions facebook/modules/profile/models.py
@@ -1,7 +1,8 @@
from django.contrib.contenttypes import generic
from django.db import models from django.db import models
from django.template.defaultfilters import slugify from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django import forms from django.conf import settings


from facebook.modules.base import Base, AdminBase from facebook.modules.base import Base, AdminBase


Expand All @@ -18,6 +19,12 @@ class Profile(Base):
_pic_large = models.URLField(max_length=500, blank=True, null=True, verify_exists=False, editable=False) _pic_large = models.URLField(max_length=500, blank=True, null=True, verify_exists=False, editable=False)
_pic_crop = models.URLField(max_length=500, blank=True, null=True, verify_exists=False, editable=False) _pic_crop = models.URLField(max_length=500, blank=True, null=True, verify_exists=False, editable=False)


# get all posts for the selected profile
# posts = [p.post for p in page.post_throughs.select_related('post').all()]
if 'facebook.modules.connections.post' in settings.INSTALLED_APPS:
post_throughs = generic.GenericRelation('PagePost',
related_name="%(app_label)s_%(class)s_related")

class Meta(Base.Meta): class Meta(Base.Meta):
abstract = True abstract = True
app_label = 'facebook' app_label = 'facebook'
Expand Down Expand Up @@ -45,4 +52,4 @@ class ProfileAdmin(AdminBase):
def pic_img(self, obj): def pic_img(self, obj):
return '<img src="%s" height="75" />' % obj._picture if obj._picture else '' return '<img src="%s" height="75" />' % obj._picture if obj._picture else ''
pic_img.allow_tags = True pic_img.allow_tags = True
pic_img.short_description = _('Picture') pic_img.short_description = _('Picture')
33 changes: 29 additions & 4 deletions facebook/modules/profile/page/admin.py
Expand Up @@ -13,7 +13,6 @@


from .models import Page from .models import Page



class PageAdmin(ProfileAdmin): class PageAdmin(ProfileAdmin):
def has_access(self, obj): def has_access(self, obj):
if obj.updated + datetime.timedelta(days=60) < datetime.datetime.now(): if obj.updated + datetime.timedelta(days=60) < datetime.datetime.now():
Expand All @@ -23,7 +22,30 @@ def has_access(self, obj):
has_access.short_description = _('Access Token') has_access.short_description = _('Access Token')
has_access.boolean = True has_access.boolean = True


list_display = ('id', 'profile_link', 'slug', '_name', 'pic_img', '_likes', 'has_access') def token_expires_in(self, obj):
if not obj._access_token_expires:
return ''
expires_in = (obj._access_token_expires - datetime.datetime.now()).days
if expires_in > 10:
return _('%s days' % expires_in)
elif expires_in < 0:
return _('<span style="color:red;font-weight:bold;">expired</span>')
else:
return _('<span style="color:orange;font-weight:bold;">%s days</span>' % expires_in)

token_expires_in.short_description = _('expires in')
token_expires_in.allow_tags = True

def insight_link(self, obj):
if '?' in obj.facebook_link:
return u'<a href="%s&sk=page_insights" target="_blank">%s</a>' % (obj.facebook_link, obj._name)
else:
return u'<a href="%s?sk=page_insights" target="_blank">%s</a>' % (obj.facebook_link, obj._name)
insight_link.allow_tags = True
insight_link.short_description = _('Name')


list_display = ('id', 'profile_link', 'slug', 'insight_link', 'pic_img', '_likes', 'has_access', 'token_expires_in')
readonly_fields = ('_name', '_picture', '_likes', '_graph', '_link', '_location', '_phone', readonly_fields = ('_name', '_picture', '_likes', '_graph', '_link', '_location', '_phone',
'_checkins', '_website', '_talking_about_count','_username', '_category') '_checkins', '_website', '_talking_about_count','_username', '_category')
actions = ['get_page_access_token'] actions = ['get_page_access_token']
Expand All @@ -34,14 +56,17 @@ def get_page_access_token(self, request, queryset):
app_dict = get_app_dict(default_post_app) app_dict = get_app_dict(default_post_app)
token_exchange = do_exchange_token(app_dict, graph.access_token) token_exchange = do_exchange_token(app_dict, graph.access_token)
logger.debug('exchanged token: %s' % token_exchange) logger.debug('exchanged token: %s' % token_exchange)
token_expires_in = datetime.timedelta(minutes=60)
if 'access_token' in token_exchange: if 'access_token' in token_exchange:
graph.access_token = token_exchange['access_token'] graph.access_token = token_exchange['access_token']
token_expires_in = datetime.timedelta(days=60)
try: try:
response = graph.request('me/accounts/') response = graph.request('me/accounts/')
except GraphAPIError as e: except GraphAPIError as e:
self.message_user(request, 'There was an error: %s' % e.message ) self.message_user(request, 'There was an error: %s' % e.message )
return False return False
#logger.debug(response) #logger.debug(response)
token_expires_in = datetime.datetime.now() + token_expires_in
if response and response.get('data', False): if response and response.get('data', False):
data = response['data'] data = response['data']
message = {'count': 0, 'message': u''} message = {'count': 0, 'message': u''}
Expand All @@ -51,7 +76,8 @@ def get_page_access_token(self, request, queryset):
for page in queryset: for page in queryset:
if accounts.get(page._id, None): if accounts.get(page._id, None):
if accounts[page._id].get('access_token', False): if accounts[page._id].get('access_token', False):
queryset.filter(id=page._id).update(_access_token=accounts[page._id]['access_token']) queryset.filter(id=page._id).update(_access_token=accounts[page._id]['access_token'],
_access_token_expires=token_expires_in)
message['message'] = u'%sSet access token for page %s\n' % (message['message'], page._name) message['message'] = u'%sSet access token for page %s\n' % (message['message'], page._name)
else: else:
message['message'] = u'%sDid not get access token for page %s\n' % (message['message'], page._name) message['message'] = u'%sDid not get access token for page %s\n' % (message['message'], page._name)
Expand All @@ -63,5 +89,4 @@ def get_page_access_token(self, request, queryset):


get_page_access_token.short_description = _('Get an access token for the selected page(s)') get_page_access_token.short_description = _('Get an access token for the selected page(s)')



admin.site.register(Page, PageAdmin) admin.site.register(Page, PageAdmin)
1 change: 1 addition & 0 deletions facebook/modules/profile/page/models.py
Expand Up @@ -13,6 +13,7 @@ class PageBase(Profile):
# Cached Facebook Graph fields for db lookup # Cached Facebook Graph fields for db lookup
_likes = models.IntegerField(blank=True, null=True, help_text=_('Cached fancount of the page')) _likes = models.IntegerField(blank=True, null=True, help_text=_('Cached fancount of the page'))
_access_token = models.CharField(max_length=255, blank=True, null=True) _access_token = models.CharField(max_length=255, blank=True, null=True)
_access_token_expires = models.DateTimeField(blank=True, null=True)
_category = models.CharField(_('category'), max_length=255, blank=True, null=True) _category = models.CharField(_('category'), max_length=255, blank=True, null=True)
_location = JSONField(_('location'), blank=True, null=True) _location = JSONField(_('location'), blank=True, null=True)
_phone = models.CharField(_('phone'), max_length=255, blank=True, null=True) _phone = models.CharField(_('phone'), max_length=255, blank=True, null=True)
Expand Down
2 changes: 2 additions & 0 deletions facebook/modules/profile/user/models.py
Expand Up @@ -21,6 +21,8 @@ class UserBase(Profile):
_location = models.CharField(max_length=70, blank=True, null=True) _location = models.CharField(max_length=70, blank=True, null=True)
_gender = models.CharField(max_length=10, blank=True, null=True) _gender = models.CharField(max_length=10, blank=True, null=True)
_locale = models.CharField(max_length=6, blank=True, null=True) _locale = models.CharField(max_length=6, blank=True, null=True)
_timezone = models.IntegerField(blank=True, null=True)
_verified = models.BooleanField(blank=True)


friends = models.ManyToManyField('self') friends = models.ManyToManyField('self')


Expand Down
2 changes: 1 addition & 1 deletion facebook/templates/admin/facebook/change_form.html
Expand Up @@ -14,7 +14,7 @@
<option value="{{ app }}">{{ app }}</option> <option value="{{ app }}">{{ app }}</option>
{% endfor %} {% endfor %}
</select-->Application: {% fb_first_app %} &nbsp; </select-->Application: {% fb_first_app %} &nbsp;
<fb:login-button show-faces="false" width="200" max-rows="1" scope="user_events, email, rsvp_event, create_event, friends_events, read_stream, publish_stream, user_photos, manage_pages"></fb:login-button> <fb:login-button show-faces="false" width="200" max-rows="1" scope="user_events, email, rsvp_event, create_event, friends_events, read_stream, publish_stream, user_photos, manage_pages, read_insights"></fb:login-button>
</div> </div>
<p>App Access Token: {{ graph.access_token }}, via {{ graph.via }}</p> <p>App Access Token: {{ graph.access_token }}, via {{ graph.via }}</p>
<p>User Access Token: <span id="user-access-token">None</span></p> <p>User Access Token: <span id="user-access-token">None</span></p>
Expand Down
2 changes: 1 addition & 1 deletion facebook/templates/admin/facebook/change_list.html
Expand Up @@ -9,7 +9,7 @@
<p>Make sure your page has an access token if you would like to post a message in the future. (Select 'get access token' from the menu above.)</p> <p>Make sure your page has an access token if you would like to post a message in the future. (Select 'get access token' from the menu above.)</p>
<p>The access token is only for the application {% fb_first_app %}.</p> <p>The access token is only for the application {% fb_first_app %}.</p>
<div id="fb-login-button" style="display:block;"> <div id="fb-login-button" style="display:block;">
<fb:login-button show-faces="false" width="200" max-rows="1" scope="user_events, email, rsvp_event, create_event, friends_events, read_stream, publish_stream, user_photos, manage_pages"></fb:login-button> <fb:login-button show-faces="false" width="200" max-rows="1" scope="user_events, email, rsvp_event, create_event, friends_events, read_stream, publish_stream, user_photos, manage_pages, read_insights"></fb:login-button>
</div> </div>
<p>App Access Token: {% access_token request %}</p> <p>App Access Token: {% access_token request %}</p>
<p>User Access Token: <span id="user-access-token">None</span></p> <p>User Access Token: <span id="user-access-token">None</span></p>
Expand Down
2 changes: 1 addition & 1 deletion facebook/urls.py
Expand Up @@ -10,7 +10,7 @@




urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^deauthorize/$', 'facebook.views.deauthorize_and_delete', name='deauthorize'), url(r'^deauthorize/(?:(?P<app_name>[A-Za-z0-9_-]+)/)?$', 'facebook.views.deauthorize_and_delete', name='deauthorize'),
url(r'^fql/$', 'facebook.views.fql_console', name="fql_console"), url(r'^fql/$', 'facebook.views.fql_console', name="fql_console"),
url(r'^log_error/$', 'facebook.views.log_error', name="log_error"), url(r'^log_error/$', 'facebook.views.log_error', name="log_error"),
url(r'^channel.html$', 'facebook.views.channel', name='channel'), url(r'^channel.html$', 'facebook.views.channel', name='channel'),
Expand Down