Re: how to define DJANGO_SETTINGS_MODULE for multiple sites.

2010-02-09 Thread rebus_
On 9 February 2010 03:25, neridaj  wrote:
> I'm trying to setup my first cron job and I think the reason my script
> is not running is because I don't have DJANGO_SETTINGS_MODULE defined
> for my environment i.e., .profile script. I'm using mod_wsgi so my
> DJANGO_SETTINGS_MODULE is defined in the respective wsgi file for each
> site, so my question is how do I setup a crontab that imports the
> correct settings module? I tried this but no luck:
>
> * * * * * django-admin.py shell --settings=sitename.settings /home/
> username/cron/syncr.py >> /home/username/croninfo.txt
>
> Thanks,
>
> Jason
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

Perhaps you can create your own management command and call it from cron.

http://docs.djangoproject.com/en/dev/howto/custom-management-commands/

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



how to define DJANGO_SETTINGS_MODULE for multiple sites.

2010-02-08 Thread neridaj
I'm trying to setup my first cron job and I think the reason my script
is not running is because I don't have DJANGO_SETTINGS_MODULE defined
for my environment i.e., .profile script. I'm using mod_wsgi so my
DJANGO_SETTINGS_MODULE is defined in the respective wsgi file for each
site, so my question is how do I setup a crontab that imports the
correct settings module? I tried this but no luck:

* * * * * django-admin.py shell --settings=sitename.settings /home/
username/cron/syncr.py >> /home/username/croninfo.txt

Thanks,

Jason

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