• Stars
    star
    392
  • Rank 105,772 (Top 3 %)
  • Language
    Python
  • License
    BSD 2-Clause "Sim...
  • Created about 11 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reddit / Hacker News clone for Mezzanine
https://secure.travis-ci.org/stephenmcd/drum.png?branch=master

Drum

Created by Stephen McDonald

Drum is a Reddit / Hacker News clone, built using Mezzanine and Django. It is BSD licensed, and designed to demonstrate some of the non-CMS capabilities of Mezzanine, such as threaded comments, ratings, and public user accounts.

Check out the blog post Building Social Apps with Mezzanine, which contains a detailed walk-through of how Drum was built. A live demo of Drum is also available.

Dependencies

Drum is designed as a plugin for the Mezzanine content management platform, and therefore requires Mezzanine to be installed. The integration of the two applications should occur automatically by following the installation instructions below.

Installation

The easiest method is to install directly from PyPI using pip by running the command below, which will also install the required dependencies mentioned above:

$ pip install -U drum

Otherwise, you can download Drum and install it directly from source:

$ python setup.py install

Once installed, the command mezzanine-project can be used to create a new Mezzanine project, with Drum installed, in similar fashion to django-admin.py:

# FIXME: add new instructions of how to create a project with drum
$ mezzanine-project -a drum project_name
$ cd project_name
$ python manage.py createdb --noinput
$ python manage.py runserver

Here we specify the -a switch for the mezzanine-project command, which tells it to use an alternative package (drum) for the project template to use. Both Mezzanine and Drum contain a project template package containing the settings.py and urls.py modules for an initial project. If you'd like to add Drum to an existing Mezzanine or Django project, you'll need to manually configure these yourself. See the FAQ section of the Mezzanine documentation for more information.

Note

The createdb is a shortcut for using Django's syncdb command and setting the initial migration state. You can alternatively use syncdb and migrate if preferred.

You should then be able to browse to http://127.0.0.1:8000/admin/ and log in using the default account (username: admin, password: default). If you'd like to specify a different username and password during set up, simply exclude the --noinput option included above when running createdb.

RSS Import

One difficulty faced with a Drum site is building up an initial user base, as well as a good amount of interesting link content. This is a bit of a chicken and egg problem, in that each of these depends on the other. One way to address this is to automatically populate the site with interesting links. To help with this, Drum provides the Django management command poll_rss for retrieving links from an RSS feed, and populating the site with them. For example, suppose I was a terrible person and wanted to populate my Drum site with links directly from the Hacker News front page and the programming section of Reddit:

python manage.py poll_rss https://news.ycombinator.com/rss http://www.reddit.com/r/programming/.rss

Here you can see multiple RSS feeds being passed to the command, which I could then run on a scheduled basis using a cron job. Note that to use the poll_rss command, you'll need the feedparser library installed.

Auto Tagging

Drum provides some basic support for automatically tagging new links as they're added. This is first configured by setting the AUTO_TAG setting to True. With that set, when a new link is added, its given title is broken up into keywords, and if those keywords already exist as tags in the database, they're applied to the newly added link.

This means that for auto-tagging to work, the tags must already exist in the database. You can either add them manually via the admin (under the "Keywords" section), or if you have a large number of existing links, you can use the auto_tag management command Drum provides, which will analyse the titles of all your existing links, and provide tags it extracts from them. This makes use of the topia.termextract package which you'll first need to install:

python manage.py auto_tag --generate=100 --assign --remove

The --generate option must be provided to extract tags, and limits the number of tags extracted. Generally more tags will be extracted than are relevant, depending on your existing set of links, so experiment with different values here. You'll likely want to review all the tags added, deleting some and manually editing others, via the Django admin interface. The --assign option will go back and assign all tags in the database to all links in the database, as would occur if they were newly created. The --remove option will cause all existing tags to be removed.

You can also define your own tag extraction function, if splitting the title on spaces doesn't suffice. To do so, define the setting AUTO_TAG_FUNCTION which should contain a string with the Python dotted path to your custom tag function. The function will be given an unsaved Link object, and should return a sequence of tags to add.

Contributing

Drum is an open source project managed using both the Git and Mercurial version control systems. These repositories are hosted on both GitHub and Bitbucket respectively, so contributing is as easy as forking the project on either of these sites and committing back your enhancements.

Please note the following guidelines for contributing:

  • Contributed code must be written in the existing style. This is as simple as following the Django coding style and (most importantly) PEP 8.
  • Contributions must be available on a separately named branch based on the latest version of the main branch.
  • Run the tests before committing your changes. If your changes cause the tests to break, they won't be accepted.
  • If you are adding new functionality, you must include basic tests and documentation.

Donating

If you would like to make a donation to continue development of Drum, you can do so via the Mezzanine Project website.

Support

To report a security issue, please send an email privately to [email protected]. This gives us a chance to fix the issue and create an official release prior to the issue being made public.

For general questions or comments, please join the mezzanine-users mailing list. To report a bug or other type of issue, please use the GitHub issue tracker. And feel free to drop by the #mezzanine IRC channel on Freenode, for a chat.

Sites Using Drum

More Repositories

1

mezzanine

CMS framework for Django
Python
4,715
star
2

django-socketio

WebSockets for Django
Python
1,312
star
3

cartridge

Ecommerce for Mezzanine
Python
697
star
4

django-forms-builder

Let users build forms in Django admin
Python
683
star
5

curiodb

Distributed NoSQL Database
Scala
512
star
6

hot-redis

Rich Python data types for Redis
Python
288
star
7

gnotty

IRC web client and bot framework
Python
159
star
8

django-overextends

Circular template inheritance for Django
Python
108
star
9

two-queues

Benchmarking Redis and ZeroMQ pub-sub, using Python and Go
Go
105
star
10

gunicorn-console

A curses application for managing gunicorn processes.
Python
90
star
11

django-postgres-fuzzycount

Fast / fuzzy PostgreSQL counts for Django
Python
86
star
12

django-email-extras

PGP encrypted / multipart templated emails for Django
Python
75
star
13

filebrowser-safe

File manager for Mezzanine
Python
41
star
14

hg-github

A Mercurial extension for working with GitHub repositories.
Python
40
star
15

vimeo-deck

Synchronize Speaker Deck presentations with Vimeo videos.
JavaScript
28
star
16

gamblor

An online casino app built for Django Dash 2012
JavaScript
26
star
17

grappelli-safe

Admin skin for Mezzanine
CSS
25
star
18

snazzymaps-browser

Android app for searching and browsing Snazzy Maps
Java
24
star
19

grillode

A web-based chat application written in CoffeeScript for Node.js
CoffeeScript
23
star
20

drawnby

Drawn By is a collaborative real-time sketching app built for the 2011 Django Dash.
JavaScript
23
star
21

babbler

A Twitter bot that polls an RSS feed and posts its entries as tweets, with auto-generated hashtags.
Python
21
star
22

tastypie-msgpack

MsgPack support for Django Tastypie.
Python
21
star
23

django-shotgun

Test entire Django sites
Python
17
star
24

linkedout

Build PDF resumes with the LinkedIn API
Ruby
15
star
25

sphinx-me

Wraps your README-only projects in a dynamic Sphinx shell for hosting on http://readthedocs.org
Python
12
star
26

readertray

Cross platform desktop notifications for RSS
Python
9
star
27

indexed-tree-map

JDK's enhanced red-black tree map algorithm to support access by index
Java
9
star
28

otr

Combined GitHub and Bitbucket API.
Ruby
8
star
29

aspchat

Classic ASP chat application
ASP
8
star
30

bitbucket-batch

A tool for bulk updating access to bitbucket.org repos.
Python
8
star
31

grillo

A terminal based chat server and client.
Python
7
star
32

mezzanine.jupo.org

Mezzanine/Cartridge project and demo site
Python
6
star
33

ratemyflight

A web app built for the Django Dash hackathon 2010.
JavaScript
6
star
34

klout-feed

Receive your daily Klout score via RSS.
Ruby
6
star
35

slbuddy

Tool for tracking sales data in Secondlife.com
Python
3
star
36

virtualboxing

Utilities for comparing timings on bulk operations across databases in a distributed environment.
Ruby
3
star
37

cryptopals

Matasano Crypto Challenges
Go
3
star
38

ghetto-life-stream

Parses items for a Google Buzz feed from various sources.
PHP
2
star
39

teamcity-client

Team City HTTP client.
Ruby
2
star
40

sydjango-damm

Code for my SyDjango talk "Django Admin: The Missing Manual"
Python
2
star
41

jquery-squeezebox

Replacement for jquery.ui.accordion to avoid dealing with jquery.ui theming.
JavaScript
2
star
42

cmdsvr

Toy web application server
Python
1
star
43

lime

JavaScript framework, predates jQuery
JavaScript
1
star
44

gedit-ftp-browser

FTP plugin for Gedit
Python
1
star