Mirror your Flickr into Django.
Project description
Django Flickr provides a mechanism to mirror user’s flickr photos into a local database.
- Sources:
Features
This application replicates your Flickr photos database (currently photos and photosets, collections comming soon) to Django models and provides management commands to sync your Django app with your Flickr content.
Dependencies
http://pypi.python.org/pypi/bunch/1.0.0 to ease up managing json data
https://github.com/alex/django-taggit for handling tags
https://github.com/feuervogel/django-taggit-templatetags (not obligatory really, but it’s an awesome addition to taggit and the example view uses it)
Installation
From pypi:
$ pip install django-flickr
or clone from bitbucket:
$ hg clone https://bitbucket.org/zalew/django-flickr
Configuration
Add ‘flickr’ to your INSTALLED_APPS and syncdb
Go to ‘Your apps’ on Flickr and generate an API key for your app. Put those data in your settings.py:
FLICKR_KEY = 'xxxxxxxxxxxx' FLICKR_SECRET = 'xxxxxxx' FLICKR_PERMS = 'read'
and add flickr.urls to your urls.py
Use cases
Sync photos:
$ ./manage.py flickr_sync [options]
available options are:
-i, --initial Initial sync. For improved performance it assumpts db flickr tables are empty and blindly hits create(). -d DAYS, --days=DAYS Sync photos from the last n days. Default is 1 day. Useful for cron jobs. -u USER_ID, --user=USER_ID Sync for a particular user. Default is 1 (in most cases it's the admin and you're using it only for yourself). --page=PAGE Grab a specific portion of photos. To be used with --per_page. --per_page=PER_PAGE How many photos per page should we grab? Set low value (10-50) for daily/weekly updates so there is less to parse, set high value (200-500) for initial sync and big updates so we hit flickr less. --force_update If photo in db, override with new data. --photosets Sync photosets (only photosets, no photos sync action is run). Photos must be synced first. If photo from photoset not in our db, it will be ommited. -t, --test Test/simulate. Don't write results to db.
How long does it take to sync?
Initial sync of 850 photos took about 90 minutes on my production server. There are sleep() to prevent dropping us by Flickr, but they steal only 23s per 100 pictures. There are a few api calls per one picture (info, exif, sizes, etc.), so it takes a while.
Download photos (NYI, TODO):
$ ./manage.py flickr_download [options]
Bugs
The project is in early stages, expect bugs. Please report any issues.
Contributors
Jakub Zalewski http://zalew.net
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-flickr-0.2.0.tar.gz
.
File metadata
- Download URL: django-flickr-0.2.0.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbc048bf32bb6104a6ad29f3595306c6c6a5c597c5b1e4a3ae797fb8944e36c5 |
|
MD5 | a02b4bff7595cce8300e86fce182264f |
|
BLAKE2b-256 | 0914f64aa756eb5e4f34febdec7ea67b8f586cc2ebcb0d73eebdc7b9158b16b1 |