On Tue, Oct 2, 2012 at 3:09 PM, Chris McComas <[email protected]> wrote: > I have a script in Django that I run manually 'python manage.py shell' and > then 'from sports import scores' and it goes out and pulls scores from a > couple URLs, modifies the data, and saves it to a SQLite database. Once that > process runs I manually scp my files to a server... > > What I'd like to do is write a shell script that I can run on a cron to run > the process at set periods, both actions. > > How would I do this so it properly runs the Django shell script? >
You can write your own custom command - so run "python manage.py mycommand": https://docs.djangoproject.com/en/1.4/howto/custom-management-commands/ Or you can setup your environment correctly, eg PYTHONPATH, DJANGO_SETTINGS_MODULE et al, and run a regular python script. No docs for this one, and I've always done the former rather than the latter. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. 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.

