June 27, 2011 13:04 / 12 comments / django snippets

About a year ago, I took over the maintenance of the django snippets site from James Bennett, who along with Jeff Croft created the site back in 2007. The site receives a steady stream of visitors who arrive mostly via search engines (71% of traffic) but there are still a decent number of people who browse the site, subscribe to the rss feeds, and submit snippets. In order to make the site more useful for the segment of users who browse the site regularly, I've added a couple small features over the past couple weeks.

Finding new content

Many of the most popular snippets predate Django 1.0 -- I wanted to make it easier to find new snippets, so I have added some simple date filtering tools on any list view of snippets. Here are some examples:

Reducing spam

Although the site requires that users have a valid email address to post snippets, this hasn't stopped a small amount of spam from creeping in.

Logged-in users can now mark snippets as "Spam" or "Inappropriate" which will hopefully expedite the process of removing irrelevant content from the site. These tools can be found in the right-hand sidebar on snippet detail pages:

Flagging a snippet

What else?

I'm interested in hearing other ideas on how to make the site more useful, so if you have anything in mind feel free to leave a comment on this post or contact me. Also feel free to send me a pull request, the code is available on Github. Look forward to hearing your ideas!

Comments (12)

  • Andrew Ingram | June 2011, at 16:45

    I'd been thinking about making my own successor, but since you're willing to do the work, even better! :)

    Anywho: 1. Specify which version of Django a snippet applies to, a lot of snippets don't work in the later versions but still feature quite highly in google search results. Any snippets which are known to break in later versions should include a message saying which version of Django they're known to break with. 2. Much better navigation, filtering etc. Now that Haystack makes search fairly trivial to implement this should hopefully mostly be a UI issue rather than a technical one. 3. Decay votes automatically over time so that more recent votes count for more, should aid with the problem of stale snippets featuring prominently.

    I'd actually love to get involved since the issues with the current site are a bit of an annoyance for me.


  • Charles | June 2011, at 16:49

    Thanks for the feedback. I actually added the django version part a while back - you can see it when adding a snippet or when performing an advanced search. It is not really exposed other than that, so adding the ability to filter on it is definitely something I plan on doing. I'll try and put some thought into cleaning up the UI but if you have any concrete ideas a simple mockup would be greatly appreciated.


  • VidJa | June 2011, at 16:57

    You already touched upon old snippets, however, even old ones are sometime highly usable. I implemented several of them in our intranet back in early 2008 and remember http://djangosnippets.org/snippets/501/ is still lurking around in our 1.3 setup with minor modifications.

    A way for users to tell that the snippet works in a certain higher version than originally posted would maybe revive the snippet and trigger updates. (much like the 'compatible up to <version> tag on the wordpress plugin page)

    Sometimes the comments have improved code. A way to score comments with valuable updates would be nice.

    If a user posts a snippet based on an older one, give the opportunity to select the parent snippet, the parent snippet could get a link to the updated snippet, although ...this functionality might already be covered by the 'more like this' part.

    One thing I have been wondering about: there is a whole bunch of links on the homepage to every possible view... except to http://djangosnippets.org/snippets/ for plain lazy browsing of all snippets. Anyway, Djangosnippets is indeed one of my favorites...


  • zyegfryed | June 2011, at 02:46

    A nice feature i'm looking since a long time is some tag faceting. Right now, we can select a tag to filter the snippets list... but we can only select one. Allowing multi-tag filtering would be great ! Another "nice-to-have" feature would be to make django-snippets gist-aware. So, that every snippets is versionned (through mercurial, git, we don't care), and allow easy fork. (Which better refers a community effort on working on a piece of code, instead of back-linking some other snippets by hand.). My two cents.


  • Martin J. Laubach | June 2011, at 04:48

    I'm checking in with DjangoSnippets every now and then (once a month or so) and browse what's new -- however, that's a royal pain because there are just five "latest snippets posted" with no possibility to page further back. Same goes for the "Feed of latest snippets", it just goes 15 snippets back.

    So a "page through the snippets in reverse chronological order with no artificial limit" would be really cool in my book.


  • VidJa | June 2011, at 07:46

    Martin, http://djangosnippets.org/snippets/ brings you to that list ;)


  • Charles | June 2011, at 10:40

    Thanks for the feedback! I've heard from another person that the /snippets/ listview should be easier to get to, will fix that one really soon.

    I like the idea of searching multiple tags, which goes along with improving filtering/search in general. Probably going to keep most of the list-views in django and do the filtering on the queryset rather than send everything to haystack.

    Making the site more like gist would be awesome...would revision history and 'forking' be enough to make that one work?


  • Martin J. Laubach | June 2011, at 11:36

    Duh, thanks for the hint -- I found out that a click on the 'snippets' tab brings you to the /snippets/ listview. I have been hunting for that for at least two years.

    Another thing that bugs me is the profileration of tags. Is it now "template", "templates"; is it "fields", "field", "form-field", "form-fields", perhaps "formfield" or even "newforms-field"?

    BTW, the /tags/ view seems to return an arbitrary order at the moment (at least it's not alphabetical). Is that intentional?


  • Charles | June 2011, at 12:10

    Yeah, the /tags/ view is ordered by number of snippets which use that tag. Providing better feedback when the user is entering tags would be nice so as to avoid tag spam.


  • Andre Terra | July 2011, at 16:08

    Things I'd love to see, including some mentioned above:

    1. Version control, forking.
    2. Decaying votes.
    3. Links to different versions of the same snippet based on django release (I can draw/write a mockup if you want).
    4. Better names for downloaded files
    5. Copy to clipboard button
    6. More compact layout for comments (too much space between lines, imho).
    7. Code highlighting for comments.
    8. Bookmarking/following snippets.
    9. Snippet writing contests with community based voting!

  • Andre Terra | July 2011, at 16:09

    +1/-1 voting of comments, possibly threaded comments too.|


  • Andre Terra | July 2011, at 12:23

    Optional screenshot upload (useful for widgets and more)


Commenting has been closed, but please feel free to contact me