Image gallery built with Pyramid web framework
Project description
PyGall
About PyGall
PyGall is a simple web photo gallery written in Python and built on the Pyramid web framework.
PyGall is licensed under a BSD permissive license.
Code is hosted on github: https://github.com/inneos/PyGall.
Be warned that this image gallery is beta software, and not full featured. It has been developped to fit my own needs, and may not suit your wishes.
But that being said, feel free to report bugs or ask for new features at https://github.com/inneos/PyGall/issues. Even better, since the code is hosted on github, feel free to fork and send pull requests.
Features
PyGall currently provides the following features:
Browse and view photos through a nice interface borrowed from Galleria.
Bulk upload of photos through the browser using jQuery-File-Upload. The photos are automatically scaled and rotated if needed.
If using F-Spot as your personal photo management desktop application, PyGall provides a script to automatically import photos from F-Spot and keep in sync your PyGall gallery.
Administer your PyGall gallery via a dedicated interface that let you update photo metadata such as date, rating, or description. You can also delete photos, or organize them through tags (which will soon be used to provide different views in PyGall).
For upcoming features, you can have a look at https://github.com/inneos/PyGall/blob/master/TODO.txt
Install
Prior to actually install PyGall and its dependencies, you should install the libjpeg and python development files, which are needed to compile the Python Imaging Library dependency. On Debian Linux you can do:
$ sudo aptitude install build-essential libjpeg-dev python-dev
You should have a working setuptools (or distribute) environment. I advise you to use virtualenv to create an isolated Python environment. On Linux you can do:
$ wget https://raw.github.com/pypa/virtualenv/master/virtualenv.py $ python virtualenv.py --no-site-packages venv
This will create a virtual environment named venv that we’ll use to install PyGall. See http://www.virtualenv.org for more information on virtualenv.
So let’s install PyGall in the freshly created venv:
$ venv/bin/pip install PyGall
PyGall is now installed. We need to make a configuration file for your PyGall photo gallery. The easiest way is to copy the file from the PyGall repository and customize it to your needs:
$ wget https://raw.github.com/inneos/PyGall/master/production.ini
This production.ini file will be used by Paster to initialize the application, create the database, and serve your application.
So you need to setup PyGall, generate a configuration for authentication (auth.cfg) and create the database (PyGall.db):
$ venv/bin/python -m pygall.scripts.setup production.ini
And finally, you can serve your PyGall application:
$ venv/bin/paster serve production.ini
That’s all, you can point your browser to http://127.0.0.1:6543 and start using PyGall.
By default, the following 2 user accounts are set up:
- An administrator account
- login: adminpassword: admin
- A guest account
- login: guestpassword: guest
Log in as administrator and you’re ready to import your first photos!
Use PyGall
When anonymous, you will be prompted for login. Only users logged in will be allowed to view the gallery.
So once logged in, you will be redirected to the PyGall index page and you will be able to view photos. Then if you are part of the admin group, you will be allowed both to upload new photos and to edit, delete existing photos. For that purpose, you can click on the ‘Upload’ and ‘Admin’ link in the upper right corner of the gallery.
If you are using F-spot as your personnal photo management desktop application, you can rather choose to use the F-spot synchronization script provided with PyGall to import photos coming from F-spot directly in your gallery. To use it, simply run the following command:
$ venv/bin/python -m pygall.scripts.fspot_sync --fspot-photosdir=/path/to/fspot/photos production.ini
By default, all photos that have the tag ‘pygall’ will be imported in your gallery. Pass –help option to see all possible options:
$ venv/bin/python -m pygall.scripts.fspot_sync --help
When your gallery is full of photos, and once you have created new user accounts (please refer to the previous section note to learn how to create new accounts), you are now able to share it with friends and family.
Changes
0.9
build an administration interface based on FormAlchemy
complete rewriting of the script that do the synchronization from f-spot
refactor and clean up the imageprocessing module so that it can be used by the f-spot sync script
image md5sum does not take the exif metadata into account so that when a tag is added or removed, the md5sum does not change anymore
add fspot_id to the PyGallPhoto model so that we are able to track photos that have been imported from F-spot
remove upper limit on SQLAlchemy dependency, so that PyGall can be used with SQLAlchemy 0.7
the static view is now also secured
upload is now much better (based on jQuery-File-Upload instead of gp.fileupload)
0.8
port PyGall to the pyramid web framework http://pylonsproject.org/
0.7
add support for other image formats than jpeg (these formats should be supported by PIL though)
add missing PIL dependency and remove pyexiv2 system dependency so that pygall now works in an isolated virtual environment built with “virtualenv –no-site-packages”
improve installation instructions
add support for i18n (with translations for “en” and “fr” languages)
prompt for admin password when setting up PyGall
0.6
refactoring and cleanups
0.5
Add support for authentication and authorization with repoze.who/what
Refactor model definition to use declarative syntax (default in Pylons 1.0)
Keep only one checkbox that will be used by both delete and import buttons
Upgrade to Pylons 1.0 and SQLAlchemy 0.6
Various small other fixes
Get rid off import phase: photos are now directly published
Reorganisation of templates directory
0.4.1
Add long_description to setup.py
Add docs and license information
0.4
fspot_to_pygall.py: speed up query by deactivating lazy loading
fspot_to_pygall.py: calculate md5sum for photos imported from f-spot
fspot_to_pygall.py: export the modified version to pygall instead of the original
Reorganize templates struture on filesystem
Move model declaration to its own file
0.3
First usable release with upload and import support.
Refactoring of mako templates using inheritance.
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.