__author__ = 'sandeep'
import sys
from hedwig.core.service import ServiceManager
from hedwig.core.worker import HedwigWorker
from django.conf import settings
import django


def main(argv):
    django.setup()
    USER_SETTINGS = getattr(settings, 'HEDWIG', None)
    msg_service = ServiceManager(HedwigWorker(settings=USER_SETTINGS), num_workers=2)
    msg_service.start()

if __name__ == "__main__":
    main(sys.argv[1:])


@@ -122,40 +122,51 @@
 ker%0A
-from
+import
  django
-.conf import 
+%0Adjango.setup()%0Afrom .
 settings
 %0Aimp
@@ -161,30 +161,39 @@
 settings
-%0A
+ 
 import 
-django
+hedwig_settings
 %0A%0A%0Adef m
@@ -207,81 +207,8 @@
 v):%0A
-    django.setup()%0A    USER_SETTINGS = getattr(settings, 'HEDWIG', None)%0A
     
@@ -262,21 +262,23 @@
 ngs=
-USER_SETTINGS
+hedwig_settings
 ), n

use module settings