My favorites | Sign in
Project Logo
                
Code license: MIT License
Labels: django, picasa, photo, gallery
Blogs:
Feeds:
People details
Project owners:
  wheaties.box

I wanted an easy way to get any random image from my Picasa Web public gallery onto my Web page, so I built this. It uses the RSS feeds provided by Google to first find all of the public albums. Then it finds all photos within the albums it finds. Basic information about each photo and album is then stored in the local database to make retrieval a bit faster. The local database can easily be refreshed when needed from the Django administration utility.

Installation

I don't have a packaged release for django-picasa yet, so you'll have to stick with an SVN version.

svn co http://django-picasa.googlecode.com/svn/trunk/picasa

Put the contents of that directory somewhere on your PYTHONPATH, and you should be good to go. To verify your installation, try the following command:

python -c "import picasa"

If that doesn't display any errors (or output at all), then your installation worked. If it spits out an ImportError, something went wrong.

Next, in your settings.py file, just add 'picasa' to your INSTALLED_APPS list, specify the gallery (or galleries) to use by specifying something like PICASA_USERS = ['mypicasausername'] in settings.py, and run ./manage.py syncdb to install the required tables. As soon as that is done, log into your site's administration panel and enter either the Picasa Albums or Picasa Photos section and click the "Refresh database" button/link. If this link is not available (you might need to install JQuery in a special place...), try going to /admin/picasa/update/.

Usage

In the template that you would like the random image to be displayed in, make sure you have {% load picasa_tags %} somewhere (most likely near the top of your template). Then you may use the {% random_picasa_photo %} template tag to insert your image.

If you're looking for some "fancy" effects, you can use the random_picasa_photo.js file that comes with django-picasa. You may find it at picasa/templates/picasa/random_picasa_photo.js. In it, I employ JQuery to change the random image every so often, fading images in and out in the process. All of the images are displayed using CSS.









Hosted by Google Code