From 4bbba8b57f84fd06386f7c4b8e39acc31974091d Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sun, 20 Mar 2011 00:15:42 +0200 Subject: some more small changes --- fb/templates/fb_gateway.html | 0 fb/templates/fb_js.html | 30 +++++++++++++++++++++--------- fb/views.py | 8 +++++++- 3 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 fb/templates/fb_gateway.html diff --git a/fb/templates/fb_gateway.html b/fb/templates/fb_gateway.html new file mode 100644 index 0000000..e69de29 diff --git a/fb/templates/fb_js.html b/fb/templates/fb_js.html index 199281c..da728ac 100644 --- a/fb/templates/fb_js.html +++ b/fb/templates/fb_js.html @@ -1,11 +1,23 @@
- - \ No newline at end of file + window.fbAsyncInit = function() { + FB.init({ + appId: '{{ FACEBOOK_APP_ID }}', + status: true, + cookie: true, + xfbml: true + }); + + FB.Event.subscribe('auth.sessionChange', function(res) { + if (res.session) { + alert('authenticated!'); + } + }); + }; + (function() { + var e = document.createElement('script'); e.async = true; + e.src = document.location.protocol + + '//connect.facebook.net/en_US/all.js'; + document.getElementById('fb-root').appendChild(e); + }()); + diff --git a/fb/views.py b/fb/views.py index 60f00ef..1ef23c5 100644 --- a/fb/views.py +++ b/fb/views.py @@ -1 +1,7 @@ -# Create your views here. +from django.contrib import auth +from django.http import HttpResponse, HttpResponseRedirect +from django.shortcuts import render_to_response +from django.template import RequestContext + +def index(request): + return render_to_response('index.html', {}, context_instance=RequestContext(request)) -- cgit v1.3.1