@receiver(post_migrate)
@receiver(post_syncdb)
def post_post_syncdb(sender=None, verbosity=0, **kwargs):
    from django.db.models.loading import cache

    # post-syncdb and -migrate are run for *each app*. This snippet determines
    # whether we're running after the LAST app in the queue.

    models_module = kwargs['app']
    if isinstance(models_module, basestring):
        # post_syncdb returns the models module, but post_migrate an app label
        models_module = cache.get_app(models_module)

    last_models_module = cache.app_store.keyOrder[-1]
    if models_module != last_models_module:
        return

    # Put your code here.