Skip to main content

A code snippet manager, originally written to power djangosnippets.org

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-cab-0.3.4.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

django_cab-0.3.4-py2.py3-none-any.whl (54.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-cab-0.3.4.tar.gz.

File metadata

  • Download URL: django-cab-0.3.4.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-cab-0.3.4.tar.gz
Algorithm Hash digest
SHA256 5289fd582e0d4d8c83458c71c9638b476c8f3d5504579901fb70942160f6bf7d
MD5 56dbf0f115c27d044f9bac489ea347d1
BLAKE2b-256 7069065bd31e1da483813d3e349349c38d57a28c79fb76210ac63a9a38096b93

See more details on using hashes here.

Provenance

File details

Details for the file django_cab-0.3.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_cab-0.3.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8f2405dda2d1f6326ec0143fcc1c38fad4a54616035fd1540c103d858335625c
MD5 02414b39daabbdbfb600154bf6e83fe3
BLAKE2b-256 916192200b9b4c08b69fcc5f9e8886ab3f02e249329e7673c027dd568737ba0f

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page