network


12
Jul 11

zsh: for lazy system administrators

Another cool zsh trick. As I am hopping to all kinds of machines all day long in my role as UNIX system administrator, for convenience, I can now just type the hostname into my shell: Previously: ~% localhost zsh: command not found: localhost After installing this into my ~/.zshrc: We get: ~% localhost Last login: [...]

12
Oct 10

Content Delivery Network: a poor-mans guide

So, keeping up with the latest buzz, I started wondering how I could set up my own CDN, or Content Delivery Network. Virtual Private Servers, or VPS, are getting cheaper every time (check out this 99¢ offer), starting at an average rate of $5 for an entry-level server. Looking at the tools and techniques at [...]

11
Jul 09

Django Social Bookmarks

The Django Social Bookmarks app does what you might expect this application to do.

It provides an easy and reusable way to get those pesky add to this social network site on a Django site.

It currently supports 34 different sites, ranging from the big ones like; twitter, facebook, slashdot, delicious, digg, technorati, strumble to local networks like nujij (Dutch), ekudos and tagmos or netjes (Belgium).

All texts in the app use Django i18n so people should have no trouble contributing both links and translations to make it truly comprehensive.

After adding social_bookmarks to INSTALLED_APPS and making sure the images are reachable you can use the provided inclusion-tag to add the links in a template.

Template example:

{% load social_bookmarks_tags %}
<div class="content">
    {{ content }}
    {% show_social_bookmarks object.title object.get_absolute_url %}
</div>

The default inclusion-tag template specifies some simple css classes so you can theme the links without having to write you own template.

CSS:

/* div around the entire block of links ^/
.socialbookmarks {
    display: block;
}
.socialbookmarks strong {
    font-weight: bold;
    color: black;
}
/* individual links */
.socialbookmarks .social {
    color: #ccc;
}
/* no borders on images */
.socialbookmarks .social a img {
    border: 0px;
}
Code is maintained in a mercurial repository and can be found here:
http://bitbucket.org/trbs/django-social-bookmarks/
Some points on the todo list for the future are:
  • Some more tags and/or api functions, for people that don't want to use the inclusion tag.
  • Putting the links in database so that they can be added, changed, enabled and disabled in the admin.
  • Add caching to the template tags

Hopefully it is useful for other people and project as well. If you want to use this in your own project, contribute with links, translations or idea please drop me a line at bitbucket or #django irc.