Installation

Introduction

The easiest way to install Photologue is with pip:

pip install django-photologue

You can also install the development version which is on Github:

git clone git://github.com/jdriscoll/django-photologue.git
cd django-photologue
python setup.py install

This code should work ok - like Django itself, we try to keep the master branch bug-free.

Python 3

Photologue works with Python 3 (3.3 or later) and Django >= 1.5. Like Django itself, support for Python 3 can be described as “should work, but needs more time on production sites to prove itself”. Use it, but make sure that all features work!

Dependencies

These 3 apps will be installed automatically if they are not already there.

Note

  • Pillow can be tricky to install; sometimes it will install smoothly out of the box, sometimes you can spend hours figuring it out - installation issues vary from platform to platform, and from one OS release to the next, so listing them here would not be practical. Google is your friend, and it’s worth noting that Pillow is a fork of PIL, so googling ‘PIL installation <your platform>’ can also help.
  • You should not have installed both PIL and Pillow; this can cause strange bugs. Please uninstall PIL before you install Pillow.
  • In some situations, you might not be able to use Pillow at all (e.g. if another package has a dependency on PIL). Photologue has a clumsy answer for this: write a temporary file /tmp/PHOTOLOGUE_NO_PILLOW, then install Photologue. This will tell Photologue to install without Pillow. It should work, but it hasn’t been tested!

Note

  • Photologue has the same support policy as Django (last 2 versions released).

Photologue also uses the Django admin app, so enable it if you have not already done so.

Configure Your Django Settings

  1. Add ‘photologue’ to your INSTALLED_APPS setting:

    INSTALLED_APPS = (
         # ...other installed applications,
         'photologue',
         'south',
    )
    
  2. Confirm that your MEDIA_ROOT and MEDIA_URL settings are correct (Photologue will store uploaded files in a folder called ‘photologue’ under your MEDIA_ROOT).

Add the urls

Add photologue to your projects urls.py file:

urlpatterns += patterns('',
    ...
    (r'^photologue/', include('photologue.urls')),
)

Sync Your Database

Use South to setup the new tables:

python manage.py migrate photologue

If you are installing Photologue for the first time, this will set up some default PhotoSizes to get you started - you are free to change them of course!

Sitemap

Photologue can be used in your site’s sitemap.xml to generate a list of all the Gallery and Photo pages.

To use, add the following to the sitemap definition section of your project’s urls.py:

...
from photologue.sitemaps import GallerySitemap, PhotoSitemap

sitemaps = {...
            'photologue_galleries': GallerySitemap,
            'photologue_photos': PhotoSitemap,
            ...
            }
etc...

Note

There is also a PhotologueSitemap class which combines the above 2 classes, but it will be removed in Photologue 3.0.