Wednesday, May 29, 2013

Re: Scripts to update Django tables

On Wed, May 29, 2013 at 3:01 PM, Brian <bkenny@gmail.com> wrote:
> I'm new to Django (and frameworks in general) and having an issue with a
> project I'm working on. Basically, I want to scrape data from a sports
> league website on a regular schedule and add updated stats into my database.
> All of the Django tutorials for models I've looked at seem to give me
> information on how to add table data manually using the manage.py shell,
> fixtures, or fields on an admin page, but I cannot find anything about doing
> this more automatically through a script. Is there something I'm missing,
> or am I trying to use Django models for something they aren't meant to be
> used for?

Django can certainly be used outside of the request cycle. You can
write management commands:

https://docs.djangoproject.com/en/1.5/howto/custom-management-commands/

or you can just use Django as you would any other python library, as
long as you configure it first:

https://docs.djangoproject.com/en/1.5/topics/settings/#using-settings-without-setting-django-settings-module

Cheers

Tom

--
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+unsubscribe@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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment