Django app for IIIF Presentation book content
Project description
Django application to index and display IIIF Manifests for books
djiffy is intended to be a reusable Django application for working with digitized book content provided via IIIF Presentation manifests. This is an alpha version and it does not yet support the full IIIF Presentation specification.
Installation
Use pip to install:
pip install djiffy
You can also install from GitHub. Use a branch or tag name, e.g. @develop or @1.0, to install a specific tagged release or branch:
pip install git+https://github.com/Princeton-CDH/djiffy.git@develop#egg=djiffy
Configuration
Add djiffy to installed applications and make sure that django.contrib.humanize is also enabled:
INSTALLED_APPS = ( ... 'django.contrib.humanize', 'dal', 'dal_select2', 'djiffy', ... )
Include the default djiffy urls at the desired base url with the namespace djiffy:
urlpatterns = [ ... url(r'^iiif-books/', include('djiffy.urls', namespace='djiffy')), ... ]
Run migrations to create database tables:
python manage.py migrate
If you are need to use djiffy to access manifests that require an authorization token, use DJIFFY_AUTH_TOKENS in your project settings to configure each domain that requires an auth token. The configuration should be formatted like this:
DJIFFY_AUTH_TOKENS = { 'example.com': 'myauthtoken', }
Usage
Import IIIF content using the import_manifest manage command. This command can take an IIIF Collection or single Manifest, via local file or URL. Imported content can be viewed in Django admin.:
python manage.py import_manifest http://url.for/iiif/manifest python manage.py import_manifest /path/to/local/collection
Development instructions
This git repository uses git flow branching conventions.
Initial setup and installation:
recommended: create and activate a python 3.5 virtualenv:
virtualenv djiffy -p python3.5 source djiffy/bin/activate
pip install the package with its python dependencies:
pip install -e .
Unit Testing
Unit tests are written with py.test but use some Django test classes for convenience and compatibility with django test suites. Running the tests requires a minimal settings file for Django required configurations.
Copy sample test settings and add a SECRET_KEY:
cp ci/testsettings.py testsettings.py
To run the tests, either use the configured setup.py test command:
python setup.py test
Or install test requirements and use py.test directly:
pip install -e '.[test]' py.test
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
Built Distribution
File details
Details for the file djiffy-0.4.1.tar.gz
.
File metadata
- Download URL: djiffy-0.4.1.tar.gz
- Upload date:
- Size: 318.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c8628af7ecfa79e4766436baa853284b60b9b4fab6f1fe41dbb5572808e71c0 |
|
MD5 | 602a0c1f306c058c12297bd48beafa70 |
|
BLAKE2b-256 | c3a20db94facb953d97449024ca15eba8ae03c71a62ab7aedefcceb908b285be |
File details
Details for the file djiffy-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: djiffy-0.4.1-py3-none-any.whl
- Upload date:
- Size: 373.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4afd00a04ff1f8653dac3c4ca59a1606e3658d42b9005527e23fb67d5570ce3d |
|
MD5 | 8b9d9bab86df1bb1581422d6a2af4200 |
|
BLAKE2b-256 | b17c3482ade639ef99d0f8cded6c024ee38bd5b6abf2060bf197320f8dd4bc4c |