0

I an trying to get django-facebook to work as per instructions given in the readme on https://github.com/tschellenbach/Django-facebook. I am new to django.

It looks simple but I am facing the following problems. I am not able to get it to work.

In the readme it says AUTH_USER_MODEL = 'member.FacebookUser'. I am guessing the right option is AUTH_USER_MODEL = 'django_facebook.FacebookUser' after importing the models - this took me some t even after making that change, syncdb throws an error stating that:

FacebookUser does not have a USERNAME_FIELD.

Not able to solve that I decided to use the default user model - auth.user. That works and I was able to load facebook/example. However after authentication from facebook, I get an error

You need to set AUTH_PROFILE_MODULE in your project settings

So I added AUTH_PROFILE_MODULE = 'django_facebook.FacebookProfile'

Now it returns a new error -

FacebookProfile matching query does not exist. Lookup parameters were {'user_id_exact': 2L}

What should I do now?

Timmy O'Mahony
  • 53,000
  • 18
  • 155
  • 177
Echo Alex
  • 60
  • 1
  • 8

1 Answers1

0

Do python manage.py syncdb or whatever it needs to be done to update your database schema with the new table (facebook_profile).

Also, you don't mention it but I have and app that uses django_facebook and I have my settings.py file like this:

TEMPLATE_CONTEXT_PROCESSORS = (
    ...
    'django_facebook.context_processors.facebook',
    ...
    )

AUTHENTICATION_BACKENDS = (
    ...
    'django_facebook.auth_backends.FacebookBackend',
    )

I hope it helps

Paulo Bu
  • 29,294
  • 6
  • 74
  • 73
  • Hey Paulo, thank you for your reply. These settings I did add to settings.py, and I did run syncdb. What I dont understand is - what does 'member.FacebookUser' mean? That is obviously a mistake right? Secondly I used my admin backend. Does that not mean that I already have a user auth installed? – Echo Alex May 17 '13 at 19:22
  • `member.FacebookUser` is either a mistake in the docs or maybe the doc example uses an app _member_ that overrides `FacebookUser` so that's why it uses this. Did you manage to get the app going? It gave me some trouble until I finally did it. If you need some more help just tell me. – Paulo Bu May 17 '13 at 20:12
  • Hey Paulo, i managed to get it to work ... finally ... i had auth installed as I was using the admin backend .. so that was the problem.. plus I did not completely understand how user auth worked .. So I dug up [djangobook-chapter14](http://www.djangobook.com/en/2.0/chapter14.html) and [extending existing user models](https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model) end to end.. implemented those stuff and it has started to work .. Thank you for offering to help..! – Echo Alex May 18 '13 at 21:32