开发者

Linking django to facebook on GAE

开发者 https://www.devze.com 2023-02-07 09:24 出处:网络
I\'ve been working using socialregistration which works on python 2.7, but doesn\'t appear to work with python 2.5 which I need to get it running on Google App Engine.

I've been working using socialregistration which works on python 2.7, but doesn't appear to work with python 2.5 which I need to get it running on Google App Engine.

Can I get suggestions on libraries which do allow me to integrate with Facebook and possibly other social networking sites which would work with python 2.5 or a fix to this particular bug? I've popped in the stacktrace below.

Thanks for any help!

Environment:

Request Method: GET
Request URL: http://localhost:8000/solve/
Django Version: 1.3 alpha 1
Python Version: 2.5.0
Installed Applications:
['djangoappengine',
 'djangotoolbox',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'solve',
 'socialregistration']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'socialregistration.middleware.FacebookMiddleware')


Template error:
In template f:\coursework\code\gae\django-guestbook\templates\base.html, error at line 19
   'facebook_tags' is not a valid tag library: ImportError raised loading socialregistration.templatetags.facebook_tags: cannot import name parse_qs
   9 :   <body>


   10 :   


   11 :    {% load facebook_tags %} 


   12 :   {% facebook_button %}


   13 :   {% facebook_js %}


   14 :   


   15 :   {% block content %}{% endblock %}


   16 :   </body>


   17 : </html>


   18 : 

Traceback:
File "F:\Coursework\Code\GAE\django-guestbook\django\core\handlers\base.py" in get_response
  109.                         response = callback(request, *callback_args, **callback_kwargs)
File "F:\Coursework\Code\GAE\django-guestbook\solve\views.py" in give_question
  74.                                'form': CreateQuestionForm()})
File "F:\Coursework\Code\GAE\django-guestbook\django\views\generic\simple.py" in direct_to_template
  28.     return HttpResponse(t.render(c), mimetype=mimetype)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\__init__.py" in render
  173.             return self._render(context)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\__init__.py" in _render
  167.         return self.nodelist.render(context)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\__init__.py" in render
  796.                 bits.append(self.render_node(node, context))
File "F:\Coursework\Code\GAE\django-guestbook\django\template\debug.py" in render_node
  73.             result = node.render(context)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\loader_tags.py" in render
  103.         compiled_parent = self.get_parent(context)
File "F:\Coursework\Code\GAE\django-guestbook\djan开发者_开发技巧go\template\loader_tags.py" in get_parent
  100.         return get_template(parent)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\loader.py" in get_template
  157.     template, origin = find_template(template_name)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\loader.py" in find_template
  134.             source, display_name = loader(name, dirs)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\loader.py" in __call__
  42.         return self.load_template(template_name, template_dirs)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\loader.py" in load_template
  48.             template = get_template_from_string(source, origin, template_name)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\loader.py" in get_template_from_string
  168.     return Template(source, origin, name)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\__init__.py" in __init__
  158.         self.nodelist = compile_string(template_string, origin)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\__init__.py" in compile_string
  186.     return parser.parse()
File "F:\Coursework\Code\GAE\django-guestbook\django\template\__init__.py" in parse
  282.                     compiled_result = compile_func(self, token)
File "F:\Coursework\Code\GAE\django-guestbook\django\template\defaulttags.py" in load
  957.                                       (taglib, e))

Exception Type: TemplateSyntaxError at /solve/
Exception Value: 'facebook_tags' is not a valid tag library: ImportError raised loading socialregistration.templatetags.facebook_tags: cannot import name parse_qs


You should be using the newer Facebook-Python SDK and Facebook Javascript SDK. I've deployed 2 Facebook applications on GAE and the newer Facebook SDKs provide everything you need to take advantage of the Graph API.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号