import glob
from django.core.management import call_command
from django.db.models.signals import post_syncdb
import os

def fixtures_loading(sender, app, *args, **kwargs):
    created_models = kwargs.get('created_models', [])
    for model in created_models:
        pth = '%s/fixtures/%s_initial.*' % (os.path.dirname(app.__file__), model.__name__ )
        fixtures = glob.glob( pth )
        if fixtures:
            print "Found initial fixtures for %s fixtures:" % model.__name__, fixtures
            call_command('loaddata', '%s_initial' % model.__name__)

post_syncdb.connect(fixtures_loading)