Mellow Morning » Django Blogging the world of IT and Business Tue, 24 Mar 2015 20:56:31 +0000 en hourly 1 Twitter way back machine Tue, 24 Mar 2015 20:56:31 +0000 tschellenbach One of the associates at Techstars created this beautiful demo of Stream’s technology (github repo). If you ever wondered about Thomas Edison’s or Nikola Tesla’s tweets, check it out! :)

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 8
How to build a notification feed using Stream Fri, 06 Mar 2015 17:20:49 +0000 tschellenbach Tommaso wrote a quick tutorial on how to build a notification feed using Django and Stream.
How to build a notification feed using Stream.

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 6
Python 3 – Stream Framework Tue, 03 Mar 2015 19:57:19 +0000 tschellenbach A quick repost for Stream Framework, Python 3 support.

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 3
Build a scalable Twitter clone with Django and Thu, 04 Dec 2014 14:31:30 +0000 tschellenbach Have a look at this tutorial on how to build a scalable twitter clone using django and

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 3
Call for contributors – Stream-Framework 1.1 Fri, 17 Oct 2014 14:01:31 +0000 tschellenbach Reblog, from:
Call for contributors – Stream-Framework 1.1

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 7
Django Facebook 5.3 Wed, 04 Dec 2013 13:00:49 +0000 tschellenbach The 5.3 release makes it a lot easier to get started with Django Facebook.
Documentation has had a major overhaul, many small bugs have been fixed and setting validation will complain if you make mistakes during the install.

Have a look at the new docs. Especially the bit documenting how to use OpenFacebook will be interesting to many people:

Getting an OpenFacebook object
Making calls

The full docs are linked on github.

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 140
Build a scalable feed using Stream-Framework and Django Fri, 18 Oct 2013 12:03:44 +0000 tschellenbach It’s been a year since the original version of this blogpost was written and it’s time for an update. The Stream-Framework is currently the largest open source solution for building newsfeed. This post will point you in the right direction if you want to build a newsfeed using Stream-Framework and Django.

We’ll be building an example app like this Pinterest style demo.

Besides the open source Stream Framework we also offer a hosted solution for building newsfeed applications at The example application code for the hosted version can be found on Github.

For the open source framework the example app code can be found here.

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 275
Django Facebook – 1.5 and custom user model support Sat, 11 May 2013 12:14:48 +0000 tschellenbach Django Facebook now officially supports Django 1.5 and custom user models! Go try it out and upgrade to pip version 5.1.1. It’s backwards compatible and you can choose if you want to keep on using profiles, or migrate to the new custom user model. Installation instructions can be found on github.


Thanks for all the contributions! My startup (Fashiolista) depends on a reliable Facebook integration and maintaining it would not be possible without all the pull requests from the community. Contributions are strongly appreciated. Seriously, give Github a try, fork and get started :)

About Django Facebook

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.

I’ve built it for my startup and it’s currently used in production with thousands of signups per day. For a demo of the signup flow have a look at Fashiolista’s landing page (

After registration Django Facebook 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

Django Facebook helps you quickly develop Facebook applications using Django.
Let me know what features or issues you are encountering!

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 165
Django Facebook hotfix, update to 5.0.13 Wed, 01 May 2013 10:35:31 +0000 tschellenbach Last night Facebook changed the format they use for codes. (codes are an intermediate step in the process of requesting access tokens.)

This change broke the caching for the convert code step for Django Facebook, breaking login, connect and registration functionality. Fortunately this was quickly reported by developers in a country where there was no Queensday yesterday.

I encourage everybody to update to 5.0.13 to make sure your Facebook integration keeps on working.

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 122
Open graph and timeline sharing using Django Facebook Wed, 03 Oct 2012 11:04:38 +0000 tschellenbach As many apps will find out today, Facebook is removing it’s offline_access permission on October 3rd. For most apps this will mean that many of your open graph shares start failing.

Fashiolista has built up quite some experience with tweaking this and today we’ll be sharing some tips. The actual code we’re using has been included in the latest version of Django Facebook.

1.) Store and retry your shares

There are several advantages of storing your open graph shares in the database. You get:

  • Stats
  • Error tracking
  • Ability to retry individual shares
  • Ability to retry a user’s shares if you get an updated token
  • Ability to delete shares (since you store the Facebook object id)

Especially the ability to retry shares was important to us. Django Facebook provides a convenient OpenGraphShare model to store all your shares in. Have a look at the example below:

class DjangoModel:
    def share_to_facebook(self, graph=None):
        from django_facebook.models import OpenGraphShare
        #this is where the magic happens
        share = OpenGraphShare.objects.create(
        result = share.send()

Note that we store all info required for sharing to Facebook in the OpenGraphShare model. The actual Facebook API request is sent when you call share.send().

Using this flow has the benefit that Django Facebook will retry your open graph shares if a user’s token updates. By doing this more of your open graph shares will actually reach Facebook.

2.) Extend your tokens

Facebook’s has deprecated offline access. By default you will now get a short lived access token (usually 1-2 hours). Often you will want longer lived tokens though. For example when your app keeps a user logged in for 30 days, storing a token once with a duration of 2 hours doesn’t get you very far. If you need longer lived tokens, you can now extend your token via a Facebook API call. These long lived tokens will keep working for 60 days.

The high level API for extending tokens is located in:


In the new version of Django Facebook your token will be automatically extended upon connecting with Facebook. There is however a performance overhead to this extra API call. That’s where the following point comes in:

3.) Use Celery

Calling the Facebook API is something which takes quite a bit of time. If you’re unlucky a single API call can easily take up to 2000 ms. Celery is a tool which allows you to easily run tasks in the background, ensuring your pages stay fast for the users. At Fashiolista we use tasks for checking comment spam, adding loves, clearing cache, posting to Facebook and extending your Facebook access tokens. You can learn more about Celery in this guide.

Setting up Django Facebook to use Celery is trivial. Simply set the following settings to True.

#Use celery for storing friends or likes
#Use celery for extending access tokens in the background

Using Celery speeds things up enormously for the end user, so I recommend using it.


Upgrading to the latest version of Django Facebook and implementing these tips will get you a very solid open graph implementation. Let me know in the comments what steps you’ve taken to get these numbers up.

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 97
Performance metrics for a social network Wed, 22 Aug 2012 14:30:38 +0000 tschellenbach This is a talk I gave at the Amsterdam Performance Meetup.

The presentation starts by introducing Fashiolista.
It still amazes me and 3 other guys started Fashiolista and grew it to the 2nd largest online Fashion community.
I guess Marc Andreesen had a point in his “Why Software Is Eating The World” article.

The talk focuses on how we use metrics to drive optimization at Fashiolista.
And narrows down on tools like:

If you’re looking up the links from the presentation, these are the most notable ones:

The Presentation

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 58
Fashiolista in NY Sat, 11 Feb 2012 18:16:16 +0000 tschellenbach The Fashiolista team is in New York for the fashion week. I’m looking forward to meet some local tech startups. Drop me a mail or leave a comment if you want to grab a coffee.

Thierry Schellenbach
CTO/ Founder

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 254
Facebook open graph publishing simplified Wed, 01 Feb 2012 19:00:15 +0000 tschellenbach Facebook has just enabled the open graph for 60 lucky apps. The new open graph beta allows you to post a user’s actions to their timeline. This activity is shown to the user’s friends in Facebook’s newsfeed and ticker. Furthermore your data is nicely aggregated on a user’s Facebook profile. Fashiolista’s aggregation for instance looks like this:

Posting these actions on Facebook can greatly enhance the viral growth of your company. Spotify, one of the launch partners, has grown by more than 4mil active users. This blogpost explains how to use Django Facebook to integrate your Django based site with Facebook.

How open graph works

Before going into the code though we need to understand the basic concepts of the open graph: actions and objects. Facebook’s getting started interface explains it best:

Actions are the verb, objects are what the action is applied to. You submit the data for these actions and objects to Facebook. An example would be watching (action) the movie Pan’s Labyrinth (object). Every object should be represented by a dedicated URL. For instance if you look at Chiara’s profile (object) on Fashiolista you will see the following open graph data:

<meta property="og:title" content="ChiaraFerragni" />
<meta property="og:image" content="" />
<meta property="og:type" content="fashiolista:fashiolista" />
<meta property="og:site_name" content="Fashiolista" />

To post to the open graph you specify an action and the url for the object. You can read more about it in Facebook’s open graph docs.

Getting permission

Users only need to give you permission to the open graph once. You specifically need the publish_actions permission. When asking for this permission a pretty permission interface as shown below will appear:

Notice the tiny add to timeline box displayed at the bottom right corner of the interface.

Posting to the graph

The code below will show you how to post to the open graph. There are however a few requirements which you’ll need to go through.

  1. Register your own Facebook app and define actions and items
  2. Have Django Facebook installed

Simple posting to the graph

After receiving this permission we can post to the user’s timeline. Below is the most basic example:

def open_graph_beta(request):
    Simple example view on how to do open graph postings
    fb = get_persistent_graph(request)
    entity_url = ''
    result = fb.set('me/fashiolista:love', item=entity_url), 'The item has been shared to fashiolista:love')

This posts the action love to the users timeline with the object data found at the url
The syntax me/fashiolista:love translates to post to me in the namespace fashiolista with the action love.

Asynchronous posting to the graph

While the above example works, you often won’t want to keep your users waiting for the Facebook API request. Especially since they are quite sluggish at the moment.
Below there’s a version of the code using celery. Celery is a task queuing system which enables you to run tasks asynchronously.

def open_graph_beta(user):
    Example posting to open graph using a celery task
    profile = user.get_profile()
    fb = profile.get_offline_graph()
    entity_url = ''
    result = fb.set('me/fashiolista:love', item=entity_url)


Integrating with open graph is easy. Head over to the github page of Django Facebook to get started. Contributions are more than welcome.

Fashiolista Jobs

Do you also see the beauty in clean code? Are you experienced with high scalability web apps? Currently we’re looking for additional talent over at our Amsterdam office. Feel free to drop me a line at my personal email for more information: thierryschellenbach[át]

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 81
Django Facebook 3.2 – Simple image upload and wall posts Sun, 23 Oct 2011 22:21:27 +0000 tschellenbach Most of the Facebook examples are written in PHP and unfortunately for us they always seem so damn simple. I think the Python libraries should allow you to write more elegant code and the new version of Django Facebook let’s you do just that.

Much of the new found simplicity comes from the facebook_required decorator. This decorator is similar to login_required, but instead checks the Facebook permissions given to you. Writing the input of a form to someone’s wall is now as simple as this:

def wall_post(request):
    fb = get_persistent_graph(request)

    message = request.POST.get('message')
    fb.set('me/feed', message=message), 'Posted the message to your wall')

    return next_redirect(request)

Another example would be uploading some photos to a user’s timeline:

def image_upload(request):
    fb = get_persistent_graph(request)
    pictures = request.POST.getlist('pictures')

    for picture in pictures:
        fb.set('me/photos', url=picture, message='the writing is one The '
            'wall image %s' % picture), 'The images have been added to your profile!')

    return next_redirect(request)

As you can see the syntax is very straightforward. You no longer have any technical excuse against integrating Facebook.
More examples and installation instructions can be found on Django Facebook’s github.

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 47
Amsterdam based, VC funded startup, Fashiolista looking for new team members Mon, 15 Aug 2011 08:44:32 +0000 tschellenbach Over the past months Fashiolista has grown to be one of the largest fashion communities worldwide. Dividing attention between scaling the site and creating new features has been quite a challenge. We are looking for a very experienced django developer to join our team.

About Fashiolista

Fashiolista is best described as “twitter for fashion”. Girls follow each other’s fashion finds and indicate which items they love. We are funded by Atomico ventures and several high profile angel investors.

Why you will love working at Fashiolista

- Young team, startup culture
- Developers in the founding team
- The team has been working with Django for more than 4 years
- Modern stack (Django 1.3, postgres, redis, memcached, jquery, celery, solr, GIT)
- Learning culture

Did I mention we are located in the centre of Amsterdam?

Who we are looking for

We are looking for a talented Django developer with experience in building highly scalable applications. Since our team is small, strong experience with Linux or Freebsd system administration would be a big plus.

  • Experienced with Django and Python (> 3 years preferably)
  • Knowledge of SQL and query optimization
  • Javascript experience
  • Test driven development
  • Memcached and other caching techniques
  • GIT

Bonus points for:

  • Knowledge of FreeBSD or Linux system administration
  • Redis/ NoSql experience
  • SOLR experience
  • Postgres Trigger experience
  • Celery experience
  • CS degree

For this position you need to be willing to work in The Netherlands/ Amsterdam. Furthermore the position is full time.

To conclude

We are looking for someone with an excellent work attitude and considerable experience. It doesn’t matter if you are a student, cum laude graduate, or drop out, as long as you’re extremely passionate about what you do. You will be working in a startup and we expect your input on a wide range of challenges.

If you recognize yourself in the above description or would like more information please contact me at:

Share and Enjoy: Digg Sphinn Facebook Mixx Google

]]> 23