#!/usr/bin/env python
import sys

try:
    import pinax
except ImportError:
    sys.stderr.write("Error: Can't import Pinax. Make sure you are in a "
        "virtual environment that has\nPinax installed.\n")
    sys.exit(1)
else:
    import pinax.env

from django.core.management import execute_from_command_line

pinax.env.setup_environ(__file__, relative_project_path=["crate_project"])

if __name__ == "__main__":
    execute_from_command_line()

@@ -22,19 +22,148 @@
 %0Aimport 
-sys
+os%0Aimport sys%0A%0Aif %22USE_NEWRELIC%22 in os.environ and %22celeryd%22 in sys.argv:%0A    import newrelic.agent%0A%0A    newrelic.agent.initialize()
 %0A%0Atry:%0A 

add newrelic to celery