I am trying to synchronize flickr with django. I am using django-syncr app. But i stacked in somewhere.开发者_JAVA百科
Database syncdb is ok. But how do we sync the images? Where do we write below code.
from syncr.app.flickr import FlickrSyncr
f = FlickrSyncr(API_KEY, API_SECRET)f.syncRecentPhotos('username', days=7)
f.syncPublicFavorites('username')http://code.google.com/p/django-syncr/
If you wanted to manually synchronize photos, you could add that code to a view that could redirect to a template that might show the updated photos.
In my opinion, a better solution would be automated background synchronization. You could either write a Python script and have it run through a cron job, or use a task management solution like celery.
精彩评论