I'd recommend caching the data using Django's caching framework and either
the local memory or memcached backend.  To update the cache, write a
management command that runs periodically as a cron job.  (If you find
yourself needing more sophisticated background task management, check out
Celery.)

Brett


On 2/8/12 4:14 PM, "bfrederi" <brfrederi...@gmail.com> wrote:

>I have some data that I retrieve using urllib and then cache on a
>different server that I frequently use through my site. Since it gets
>used so frequently, I was wondering why it might be a good/bad idea to
>make the urllib request in the settings.py. It's data that gets
>changed infrequently, but should update every once in a while, but I'd
>prefer that it stayed in local memory as much as possible, since it
>gets used so much. Any advice on how to make a dynamic global variable
>like that is much appreciated.
>
>Thanks,
>Brandon
>
>-- 
>You received this message because you are subscribed to the Google Groups
>"Django users" group.
>To post to this group, send email to django-users@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.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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.

Reply via email to