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
Javier García Sogo https://bitbucket.org/jgsogo
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.3.tar.gz
.
File metadata
- Download URL: django-flickr-0.2.3.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 675da4a05fcdbf4ee3a726d151f08baee47db9d79f8e5cb03bc9f298c0f19357 |
|
MD5 | 98a57458d1492708605d6c2af63efa8d |
|
BLAKE2b-256 | 045dcecc7d6c63c17263dcb98db0cdbc0e9ae43796d9a7aca3cda80622df2443 |