Hacker Newsnew | comments | show | ask | jobs | submit login
Django Facebook (readthedocs.org)
79 points by pajju 1128 days ago | 18 comments



If you're making a Facebook canvas app in Django, another option is Fandjango:

https://github.com/jgorset/fandjango

-----


I spent a few hours trying to set up Django Facebook before finding fandjango. It's a breeze to set up and very nice to use.

-----


I had the same experience. Django Facebook gave me a few issues in the standard, out-of-the-box configuration, so I looked around and found Fandjango, which worked well (unfortunately, it's only for canvas apps, not a mixed or off-facebook app).

Having said that, I contacted the maintainer of Django-Facebook on Github, and he not only tried to help me at the time, he was kind enough to let me know that a new version came out which should fix the issues I was having. I'll definitely be giving Django-Facebook a try on my next project.

-----


People are already using Django Facebook for canvas pages. It's a bit alpha at the moment though. Might have to tweak some things while working with it. Should be more stable in the coming releases.

-----


I like it. Seems easier to setup then django-social-auth. The extra information given on the blog is nice too.

-----


Thanks

-----


settings.py is the new php.ini

-----


I think we're OT, but : I had the same fear about settings.py, but good practices will win out. Django does allow a lot of configuration (rather than convention) so your django project will need to hold a lot of settings, but I tend to modularize my settings.py into:

    * settings_env/convention.py
    * settings_env/project.py
    * settings_env/logging.py
    * settings_env/local.py
    * settings_env/dev.py
    * settings_env/staging.py
    * settings_env/production.py
Then my settings.py is just:

    from settings_env.convention  import *
    from settings_env.project      import *
    from settings_env.logging import *
    
    env = os.environ.get('DJANGO_ENV')
    if env == "production" : from settings_env.production   import *
    elif env == "staging"  : from settings_env.staging      import *
    elif env == "dev"      : from settings_env.dev          import *
    else                   : from settings_env.local        import *

There are still a lot of settings, but, at least, they're organized logically. And my convention.py doesn't change from project to project, so I can pretty much ignore that. project.py just contains overrides to the conventions.

-----


Over at Fashiolista.com we do something similar. The setting system has 3 levels. Default, environment and local. Maybe we'll opensource it at somepoint, not yet entirely happy with it though.

-----


how settings.py gets so large is not only a valid problem in of itself, but also symptom of another problem: it is hard (or at least not obvious) to have configuration that can be changed from the admin.

i've considered implementing something that works similarly to the sites contrib app for this, but it always seems that for it to be useful it needs to hook into django internals more than apps "are supposed to".

-----


> it is hard (or at least not obvious) to have configuration that can be changed from the admin.

You are doing settings.py wrong. You should have your own SiteConfig model stored and manipulated in a db.

Settings.py is for static, persistent attributes, not for site-wide variables which need auditing or updated from time to time.

-----


Care to elaborate. I have never worked on php but I am concerned by settings.py clutter.

-----


Great app. I actually had a showstopper with it just a few days ago [1], though the patch got merged pretty fast.

Definitely consider dajngo-facebook if you need a quick and stable way to do Facebook integration.

[1] - https://github.com/tschellenbach/Django-facebook/issues/116

-----


I've used version 3 before, and it worked great. The dependency on django-registration or django-userena actually turned me on to Userena, which I'm very happy about.

I guess the reason that its bubbling up to the front page is to let people know it exists? I guess I'll lay down my recommendation, then. Its good stuff.

-----


django-userena is nifty, I'm surprised it's not used more often.

-----


Good work tschellenbach ! remeber django-facebook more or less broken a year or so ago and now on hn!

-----


Downvote, I have no idea what this is by looking at the first few lines of the homepage.

-----


Whow, friend just forwarded this to me. Cool to see my project on HackerNews. I'm still brushing up the docs, not quite perfect yet. But to explain what it does:

Django Facebook enables your users to easily register using the Facebook API. It converts the Facebook user data and creates regular User and Profile objects. This makes it easy to integrate with your existing Django application. After registration it gives you access to user's graph. Allowing for applications such as:

Open graph/ Timeline functionality Seamless personalization Inviting friends Finding friends Posting to a users profile I've built it for my startup Fashiolista.com and it's currently used in production there with thousands of signups per day. For a demo of the signup flow have a look at Fashiolista's landing page (fashiolista.com)

Before you get started building your application, know that contributions are very welcome. Seriously, if you see a bug or think of an improvement just open a pull request or issue. Feel free to contact me if you have questions.

Updates and tutorials can be found on my blog mellowmorning

Further demos and tutorials will soon be available on django-facebook.com

-----




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: