recommend you check out django-extensions jobs.
http://code.google.com/p/django-command-extensions/


On 20 Nov 2008, at 12:53, laspal wrote:

>
> hi,
> I am writing cron job for my application but run into problem
>
> from django.core.management import setup_environ
> import settings
> setup_environ(settings)
>
> from test.crm.models import CronEmail
>
> Basically the problem is I am not able to import any model.
>
> I tried this too:
> pathname = os.path.dirname(sys.argv[0])
> sys.path.append(os.path.abspath(pathname))
> sys.path.append(os.path.normpath(os.path.join(os.path.abspath
> (pathname), '../')))
> os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
>
> but still can import any model.
>
> Thanks
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to