The easiest way would be using a custom management command https://docs.djangoproject.com/en/1.8/howto/custom-management-commands/
On Wed, Oct 14, 2015 at 10:53 AM, 'Chris Norman' via Django users < django-users@googlegroups.com> wrote: > Hi again, > I would like to set up a cron job to email the day's journeys to a > pre-defined set of email addresses, using the model I described in the > previous example. > > I have it so I can type: > > python manage.py shell > import journey_sender > > This does everything. > > Thing is, I would like to use the server's cron demon to do this, so I > can't work it in the way I just described. I tried using combinations of > pipe characters, but to no avail. > > Is there some way I can programatically simulate the shell yielded by > manage.py? Or is there a smarter way of running the cron job from within > Django it's self? > > Thanks in advance, > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/561E5E70.3060901%40googlemail.com > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei1wGy6WdBeOoM7KULuLQ45wtDXEsVX0NRExfruuTe8W8g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.