Skip to content

Instantly share code, notes, and snippets.

@chris-ramon
Created January 17, 2013 20:08
Show Gist options
  • Save chris-ramon/4559263 to your computer and use it in GitHub Desktop.
Save chris-ramon/4559263 to your computer and use it in GitHub Desktop.
import django.
#! /usr/bin/env python
#coding:utf-8
import sys
import os
sys.path.insert(0, os.path.expanduser('/home/chris/Projects/royalpioneers'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'royal.settings'
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from django.db.models.loading import get_models
for m in get_models():
exec "from %s import %s" % (m.__module__, m.__name__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment