Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 64 lines (44 sloc) 2.103 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
===
Cab
===

Cab (named for the jazz bandleader and scat singer Cab Calloway) is a
Django application which allows users to post and share useful
"snippets" of code.


Installation notes
==================

Cab has a couple of external dependencies:

    * `Pygments`_ for code highlighting.

Additionally, the default setup requires a few applications which are
bundled with Django itself:

    * ``django.contrib.comments`` to enable commenting.

    * ``django.contrib.markup`` to handle Markdown formatting of
       comments.

    * ``django.contrib.syndication`` to enable feeds.

It's also recommended that you have ``django.contrib.admin`` installed
for ease of site maintenance.

Once you've got those taken care of, do a Git checkout of Cab
from somewhere on your Python path::

    git clone git://github.com/girasquid/cab.git
python cab/setup.py install

Then add ``cab`` to the ``INSTALLED_APPS`` setting of your Django
project, run ``manage.py syncdb``, and either put a call to
``include('cab.urls')`` somewhere inn your root URLConf or copy over
the URL patterns from Cab that you want to use.

Note that the ``get_absolute_url`` methods of the ``Language``,
``Snippet`` and ``Tag`` models assume that they will live under the
URLs ``/languages/``, ``/snippets/`` and ``/tags/``, so if you want
them to go elsewhere you'll need to edit those methods or ovveride
them with Django's ``ABSOLUTE_URL_OVERRIDES`` setting.

.. _Pygments: http://pygments.org/


Templates
=========

The Git checkout will get you a set of example templates
matching those currently in use on `djangosnippets.org`_, but they
assume the existence of base project-wide templates used by that site;
you'll need to either create templates with the same names to extend,
or edit the included templates to suit your site's layout.

If you choose to simply create the appropriate base templates, you
shouldn't need to do anything special to have Django pick up Cab's
built-in templates; Django's "app directories" template loader should
notice them and use them.

.. _djangosnippets.org: http://www.djangosnippets.org/
Something went wrong with that request. Please try again.