Skip to content

Instantly share code, notes, and snippets.

@acdha
Created July 22, 2009 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acdha/152266 to your computer and use it in GitHub Desktop.
Save acdha/152266 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import os
PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, os.path.join(PROJECT_ROOT, "apps"))
sys.path.insert(0, PROJECT_ROOT)
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from django.core.management.commands import test
import logging
def main():
# Since we're not running in a server, we'll just dump everything to the console:
logging.basicConfig(level=logging.DEBUG, format='%(levelname)s: %(message)s')
# Initialization:
# call_command('loaddata', verbosity=0, ['fixtures1'])
# from django.conf import settings
# settings.INSTALLED_APPS.append('NoSuchApp')
c = test.Command()
c.handle('core')
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment