Wednesday, May 29, 2013

Re: Scripts to update Django tables

On 30/05/2013 12:01am, Brian 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.

I think the way you have described the task is a little scary. It sounds
as though you haven't bothered to get permission to acquire the data. I
could be wrong.

What you want however isn't too difficult to achieve. The Django
framework was/is designed to build interactive websites layered on top
of a database. So once you have modelled your data in Django and created
your database accordingly you are nearly there. Django is (much more
than) just a bunch of Python libraries which incude mechanisms for
saving data. You need to write your own Python script to munge the
incoming data to match your model(s) and call Django routines to save it
into the database. I haven't done that myself but that's how I would
tackle it.

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?
>
> --
> 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.
>
>

--
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