Installation

In this section we’ll show how to install DJFacet.

Dependencies

  • Django 1.1 or above (download). DJFacet 0.9 is compatible with Django 1.1+; future versions will be tested only on Django 1.3 only.
  • Django picklefield (download).
  • Optional: Django MPTT (download).

These libraries are needed for DJFacet to work: install them system-wide or elsewhere, as long as they can be located via your PYTHONPATH setting.

Warning

Support for hierarchical facets via django-MPTT is still being tested and will be released in future versions of DJFacet.

Step by step installation

Step 1: Download and unpack the application

Download the latest version of DJFacet from google code: http://code.google.com/p/djfacet/downloads/list

Expand the package just downloaded and put it in a suitable location. This can be the same folder as the django project you’re working on, or any other location, as long as it is in your PYTHONPATH:

$ tar xfz djfacet-VERSION.tar.gz
$ cp -r djfacet /path/to/my/project/

Step 2: Set up the templates directory

DJFacets includes some default templates, which need to be made accessible by putting them where Django can find them. To this purpose, you must copy the folder named djfacet inside your project’s templates directory (usually defined via Django’s TEMPLATE_DIRS setting):

$ cd /path/to/my/project/djfacet
$ cp -r templates/djfacet /path/to/my/project-templates/

Alternatively, you can just create a symlink:

$ ln -s templates/djfacet /path/to/my/project-templates/

Step 3: Set up the media directory

Do the same operation as above with DJFacet’s built-in static files (css, js). Copy the folder named djfacet, located inside the static of DJFacet distribution, to your project’s media folder (usually defined via Django’s MEDIA_ROOT setting), or create a symlink:

$ cd /path/to/my/project/djfacet
$ cp -r static/djfacet /path/to/my/project-media-files/

Alternatively, create a symlink:

$ ln -s static/djfacet /path/to/my/project-media-files/

Step 4: Add the application to your project

Add the DJFacet app to your project’s settings.py:

INSTALLED_APPS += (
        'mptt',             # optional, if installed
        'picklefield',      # REQUIRED
        'djfacet',          # REQUIRED
)

Now run the syncdb command. DJFacet will create 3 new tables, which are used by the caching system:

$ python manage.py syncdb
Creating table djfacet_cachedfacetquery
Creating table djfacet_cachedfacetvalue
Creating table djfacet_cachedfacetedmanager

Step 5: Wire up the application urls

Add the DJFacet app to your urls definitions in urls.py:

urlpatterns += patterns('',
        (r'^browser/', 'djfacet.urls'), # change "browser" to whatever you like!
)

Once that works, congratulations! You’ve successfully installed DJFacet. Now it’s time to proceed to its Configuration.