0

I'm using django-facebook and for some strange reason it stopped working. Ofcourse I changed something, somewhere for it to happen. But as you might have guessed I'm clueless for the moment.

The error message I get it:

TemplateSyntaxError at /facebook/connect/

Caught TypeError while rendering: unhashable type: 'dict'

 Method:    GET
 Request URL:   http://dev.wiespeeltwaar.be/facebook/connect/
 Django Version:    1.3
 Exception Type:    TemplateSyntaxError
 Exception Value:   

 Caught TypeError while rendering: unhashable type: 'dict'

 Exception Location:    /home/jonasg/django-wiespeeltwaar/django/utils/functional.py in wrapper, line 22
 Python Executable:     /home/jonasg/.virtualenvs/wiespeeltwaar/bin/python
 Python Version:    2.6.6
 Python Path:   

 ['/home/jonasg/dev/wiespeeltwaar',
  '/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg',
  '/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg',
  '/home/jonasg/django-wiespeeltwaar',
  '/home/jonasg/dev/wiespeeltwaar',
  '/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6',
  '/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/plat-linux2',
  '/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/lib-tk',
  '/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/lib-old',
  '/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/lib-dynload',
  '/usr/lib/python2.6',
  '/usr/lib/python2.6/plat-linux2',
  '/usr/lib/python2.6/lib-tk',
  '/home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages']

 Server time:   zon, 11 Dec 2011 22:41:03 +0100
 Template error

 In template /home/jonasg/.virtualenvs/wiespeeltwaar/lib/python2.6/site-packages/django_facebook/templates/django_facebook/connect.html, error at line 87

 86     <!--form to call registration via facebook -->
 87     <form action="{% url facebook_connect %}?facebook_login=1" method="post">
 88     <h2>Register, login or connect with facebook</h2>

For some reason the url templatetag can't give me the url of the facebook_connect view.

Any help is appreciated!

Jonas Geiregat
  • 5,214
  • 4
  • 41
  • 60
  • Looks to me like `facebook_connect` is a dict in the context, and that's messing up the url tag. But just a guess. – Izkata Dec 12 '11 at 01:11
  • Could you, please, post your urls.py here? I think you got error there. – Ilya Dec 12 '11 at 00:43

2 Answers2

2

The error isn't actually in the url tag, it's just that that tag causes code to be imported that has a problem. Somewhere you're trying to use a dictionary as a dictionary key.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
0

That's a rather hard to debug, somewhere in your code.

Looking at the stacktrace:

/home/jonasg/django-wiespeeltwaar/django/utils/functional.py in wrapper

if mem_args in cache:

    ...

▼ Local vars
Variable    Value
mem_args    

({'backend': 'wiespeeltwaar.accounts.backends.WswBackend',
  'form_class': <class 'registration.forms.RegistrationFormUniqueEmail'>},)

args    

({'backend': 'wiespeeltwaar

.accounts.backends.WswBackend',
  'form_class': <class 'registration.forms.RegistrationFormUniqueEmail'>},)

num_args    

1

cache   

{('api.views.add_loved',): <function add_loved at 0xa2bf1b4>,
 ('api.views.del_loved',): <function del_loved at 0xa2bf294>,
 ('api.views.details',): <function details at 0xa2bf064>,
 ('api.views.get_concerts',): <function get_concerts at 0xa2bf304>,
 ('api.views.loved',): <function loved at 0xa2bf17c>,
 ('api.views.search_artist',): <function search_artist at 0xa2befb4>,
 ('api.views.search_gig',): <function search_gig at 0xa2bf2cc>,
 ('api.views.set_notify_methods',): <function set_notify_methods at 0xa2bf224>,
 ('django.views.static.serve',): <function serve at 0x9b57b1c>,
 (u'facebook_connect',): 'facebook_connect',
 ('wiespeeltwaar.accounts.views.add_favartist',): <function add_favartist at 0xa2bfa3c>,
 ('wiespeeltwaar.accounts.views.del_favartist',): <function del_favartist at 0xa2bfaac>,
 ('wiespeeltwaar.accounts.views.profile',): <function profile at 0xa2bfa74>,
 ('wiespeeltwaar.gig.views.index',): <function index at 0x9f9ea3c>}

func    

<function get_callable at 0x9aba2cc>

It seems that I've found the place where things go horribly wrong. (u'facebook_connect',): 'facebook_connect', This line doesn't look right at all!

Jonas Geiregat
  • 5,214
  • 4
  • 41
  • 60