Commit b8a2cc44 by Justin Riley

add runpy django management command for lms

Runs a Python script within the edx platform's lms environment.
parent a3b8aa10
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
args = "<script>"
help = "Run a Python script within the edx platform lms environment"
def handle(self, *args, **options):
if len(args) != 1:
raise CommandError("missing script argument")
script = args[0]
return execfile(script)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment