Skip to main content
Build Status

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.

This code is used to power the snippet sharing site, djangosnippets.org

Installation notes

Cab has a couple of external dependencies:

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, grab a git checkout of Cab from somewhere on your Python path:

git clone git://github.com/django-de/djangosnippets.org.git

Then add ratings, taggit and cab to the INSTALLED_APPS setting of your Django project, run manage.py syncdb, and either put a call to include('cab.urls.snippets') 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.

For search support you need to set up a search engine and configure haystack:

# Place where search indexes are stored for snippets - should be non web accessible
HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
        'PATH': '/some-path/search-index',
        'STORAGE': 'file',
        'POST_LIMIT': 128 * 1024 * 1024,
        'INCLUDE_SPELLING': True,
        'BATCH_SIZE': 100,
    },
}
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'

Templates

The git repo will get you a set of example templates matching those currently in use on djangosnippets.org

OMGWTF Tests?

Yeah, there are tests now. See https://travis-ci.org/django-de/django-cab

Release files for django-cab 0.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-cab 0.3.7
File Size Uploaded
django-cab-0.3.7.tar.gz 32.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-cab 0.3.7
File Interpreter ABI Platform
django_cab-0.3.7-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 86.0 kB

Release files / django-cab-0.3.7.tar.gz

Download URL django-cab-0.3.7.tar.gz
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e4747027a5441bf91ba16940f9dc02c9c9439135df67d61fc1dae5713b814561
BLAKE2b-256 checksum
How to use checksums
d9f5ded9d38e0217ad83cc83328480d01f03c61aa308b8661d00bb0fcec392d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_cab-0.3.7-py2.py3-none-any.whl

Download URL django_cab-0.3.7-py2.py3-none-any.whl
Size 54.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
13e93afe88767a8dcd52b7860d952d8666298c97f12488fa2be9e27d9caf30e3
BLAKE2b-256 checksum
How to use checksums
5a14fafe38bd598e75f217da24d603fe17f4fe1824f8430643d44aebecfc8a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.7 This release

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page