Degal is a HTML photo gallery script written in Python.


Degal was originally based on a similar HTML gallery script called EGAL, written by Santtu Pajukanta, rewritten to add more features such as support for sub-folders (!).

Releases 0.1 - 0.2 remained fairly simplistic single-module scripts which were manageable, but development in the old SVN repository quickly split the code up into a package. At this point the packaging and structure quickly fell apart, with the resulting code and CGI scripts being barely useable by myself.

In early summer 2009, I picked up development again, heavily refactoring the old svn code into a (hopefully) better structure.

Currently, the only releases are still from the old first-generation era, but hopefully we should be seeing a third-generation release fairly soon :)


  • Generate static per-folder/img .html files for a directory tree
  • Generate thumbnail and preview versions of each image


Release versions

Development version

hg clone

Installation and usage (for release versions)

Extract the archive file and move these files and directories to where your images are:

  • .htaccess
  • shorturl.cgi
  • style.css
  • templates/

If you wish to use ShortURLs and run DeGAL with mod_userdir, you may need to modify the .htaccess to set the RewriteBase.

If you now execute on the command line, it will scan through your images, create thumbnails, preview images, as well as generate the HTML gallery pages.

Gallery (directory) titles may optionaly be specified in a file called title.txt in each directory. If present, it should contain a short title that will be used for all links to that gallery. You may also add a longer description (after the title, seperated by three dashes, ---, extra whitespace will be stripped away) which will be shown on the directory's index page.

The same may be done for induvidual images (replace the file extension with .txt, i.e. DSC0001.jpg becomes DSC0001.txt) whereupon the URL for the image will use a simplified version of the image's title.

It is also possible to specify a list of directories/files to index as command-line arguments to, in which case it will only process those files. Note that a directory index will only be updated if the directory itself is included in the filter.


Release version / Development core

Development optional


  • 0.2
    • Added ShortURL feature
    • Added ability to specify a list of files to update on the command line


Source Repository


Example Gallery