March 14, 2009 will

The low-down on Django-Techblog

I figured I would write-up some of the features of Django Techblog, the blogging application I wrote to power this site. It does most of what you would expect from a blogging app, but there are a few features that it does differently. The main difference is extended markup, but there are a couple of other features that worthy of note:

  • Multi-blog capable. I want to blog on a variety of subjects, but because some of the things I post about (namely the geeky stuff) are only of interest to a select few, I risk turning away visitors who aren't interested in those techy posts. Categories and tags are one solution to this, but I prefer to have a number of blogs under an umbrella blog, each with its own posts, templates and tags. In Techblog, there is also a concept of a channel which appears exactly like a blog from the front-end, but aggregates posts & tags from one or more blogs. In this site, the home-page at / is actually a channel consisting of /blog/tech/ and /blog/personal.
  • Microblogging. Techblog has support for Twitter and potentially other microblogging services could be added. You add your twitter account details, which Techblog uses to poll your tweets and automatically post them to a specified blog. It filters out replies because they are rarely of interest to anyone other than who the reply is intended for, and also parses hashtags to create equivalent tags in the blog system. A microblog post can have a unique template (just a Django template) so they can have a different look and feel to regular posts. You can check my tweets in /blog/microblog/.

Getting the Code

The code for Django-techblog is licensed under my politeware license, which means you can use it for any purpose you see fit, but I would appreciate a thank you! It shouldn't be too difficult to set-up if you have worked with Django, but I'd be happy to help if you experience any problems with it. See the Google Code page for the SVN url:

http://code.google.com/p/djangotechblog/

Use Markdown for formatting
*Italic* **Bold** `inline code` Links to [Google](http://www.google.com) > This is a quote > ```python import this ```
your comment will be previewed here
gravatar
Samat
How/why different are multi-blogs from tags?

I'm coming from the Drupal camp, where tags can each have their own feed.
gravatar
Ben Atkin
Nice blog, and your blogging engine looks nice, too! I found out about this on http://djangosites.com/.

I see what you mean about having personal tags separated from technical tags. It's a bit easier to go through your technical tags without the personal tags cluttering it up. However, your list of tags is not that easy to find. Even if you find that you don't like tag clouds, I think a link to a list of tags on each blog's main page would be nice.
gravatar
WIll McGugan
Samat, actually Techblog has a feed for tags (see /tag/django/ for example. The main difference is that everything under the blog blog root is independant from the rest of the site, and you wont see posts referenced from the other blogs.

Ben, I think you may be right about that! I'll have a think about the best place to put it…
gravatar
V
Interesting app, I was planning on doing something similar. Thanks for sharing it!

Otherwise, I've found a bit strange that coming to this post from the rss feeds or from your homepage actually results in different links and contents. About the latter, there is no “Projects” link if I open the post from your Homepage. I've found this rather strange.
gravatar
Kegan Gan
Awesome! This is just what I am looking for :) Thanks!
gravatar
Will McGugan
V, it is a little strange I guess, but it is because each post appears in its blog root url and also aggregated in the site root. I guess I could make it so that in the root blog, the title links point at the appropriate blog…

Kegan, you are welcome!
gravatar
ger
Hi
Anybody try “Django Techblog” with pinax?
It´s difficult to integrate with pinax?
gravatar
Gour
Hi!

I'm also interested for the same thing, integration with Pinax as well as e.g. with django-cms-2?

Otoh, I'd like to publish blog entries remotely by writing in .rst and sending to the blog. Is there a plan to support some remote-publishing API (MetaWeblog, Atom)?


Sincerely,
Gour
gravatar
Will McGugan
Ger, I haven't tried, but in theory it shouldn't be too hard!

Gour, haven't tried but it should work.

No plans to add support for remote-publishing at the moment, but I would accept patches!
gravatar
Gour
Hi Will,

I asked similar question on pinax-users list and here is the reply which I received:

After a quick inspection, django-techblog has its own tagging, comments, and microblog models, and its own static pages, account management, so it does not use Pinax's existing infrastructure. Also, the code is organized as a project, not an app. Doesn't mean you couldn't integrate it with a Pinax site, but it'll probably take some effort,

So, it seems as doable but not easy…

Otoh, as far as remote-publishing is concerned, I know there is a ticket in Django for Atom PP support and I've found one django-blog with the patch for XMLRPC support (see this ticket).


In any case, I'll try to take a look at it after becoming more familiar with Python/Django.

Sincerely,
Gour
gravatar
Will McGugan
Gour,

I see what you meant regarding integration. Techblog is unaware of Pinax, so true integration would require modification of the Techblog code. It could certainly live along side a Pinax app, but the blogs would have to remain under control of the webmaster because there is no user model other than admin users and visitors…

If you ever give it a try, feel free to ask me for assistance!

Will
gravatar
Gour
Will,

If you ever give it a try, feel free to ask me for assistance!

Sure. ;)

I'll also try to see how it would play with new django-cms available at github.


btw, let me not forget to say that your blog look very nice. ;)


Sincerely,
Gour
gravatar
Gregor
Hi Will,
i really like your blogging engine its cool. I tried to set it up, but i run into problems. It says me that there is no reverse look up for the named url “blog_front”:

Reverse for 'blog_front' with arguments '()' and keyword arguments '{'blog_slug': u'rootblog'}' not found.

(this error occurs when i try to access /blog/rootblog/. When i access / i'll get

Reverse for 'blog_feeds' with arguments '(u'rootblog', 'posts')' and keyword arguments '{}' not found.

Thannks for your help,
Gregor
gravatar
Will McGugan
Hi Gregor,

You will need to set up a blog or a channel with the slug ‘rootblog’, which you can do through the admin site (/admin/).

If you want to use multi-blogs then rootblog should be a Channel, so you will also have to create one or more Blogs then add them to the Channel

Hope that helps,

Will
gravatar
Gregpr
Hi, yes the blog and the channel is setup. And i think it has nothing to do with the models. It tells me that he cannot find the reverse lookup. But i have not touched the ROOT_URLCONF file and the techblog.apps.blog.urls file.

Thanks for your quick response.
gravatar
Will McGugan
Gregor, I'm not sure. The code is identical to what is running the site (other than local_settings.py).

Can you send me the tracebacks for the pages that aren't working?

You might want to contact me direct rather than do it through the comments…

Will
gravatar
Bill Sanders
I've got the Techblog up and running… just wanted to say it looks great, I'm really impressed! Excellent visually, and easy to navigate.

A note on dependencies: There's a lot of them! That's not a problem, but it'd be good to list them somewhere (my apologies if they already are). From my Slackware 12.1 Full install (and aside from Django and its dependencies, of course) I also had to install:
* BeautifulSoup
* Imaging
* Pygments
* libevent
* memcached
* postmarkup
* python-memcached
* simplejson

Anyways, thanks for this release. I hope to see more added to it, but in the meantime I think I'm going to switch over to it for my personal blog.
gravatar
Will McGugan
Bill, glad you like it! I'm afraid there is no documentation of any kind, but let me know if there is anything that you can't figure out.

Be sure to let me know the url to your blog once you are set up. Soon there will be 3 Techblogs online… :-)

Regarding Postmarkup, you may need the SVN version. A new official release will be coming soon.
gravatar
Will McGugan
And what do you mean the dependencies aren't documented. They are right there, on the blog post! :-P
gravatar
Louis
Just wondering, how do I actually get this working on a server?
gravatar
Will McGugan
Hi Louis,

You can install it as any other django app. See http://www.djangoproject.com for more information…
gravatar
Jury
Will it work with WYSIWYG editor for postings ? And, will it work (or can it be adapted) in multi-user environment, like 2degreesnetwork.com or other sites where many users can have many blogs ?
gravatar
Will McGugan
It doesn't have a WYSIWYG editor at the moment. But it would be simple enough to edit the template and set the default format to HTML.

Blogs do have a concept of ownership, but it is designed for a few trusted users submitting content, not for a true multi-user environment.

That said, it could easily be adapted for it by a little logic that restricts users to editing their own blog.
gravatar
Benjamin
You blog looks awesome. I would really like to try it out on google app engine. Would that be possible?
gravatar
Will McGugan
Benjamin,

I haven't tried it on GAE. I don't know if GAE can run all DJango apps, I suspect you would have to modify it a little.

Let me know if you get it working!

Will
gravatar
Mark
Great Blogging software, thanks! I'm trying to get rid of the “rootblog” in my url…

http://127.0.0.1:8000/blog/rootblog/

I've renamed the variable in settings.py:

DEFAULT_BLOG_SLUG = “myblogname”

and given my default blog the same slug in admin, but I'm still throwing this error when I go to:

http://127.0.0.1:8000/blog/myblogname/

I've searched the project for any other instances of “rootblog” and can't find any, so I'm at a loss. Any help would be greatly appreciated. Thanks again for the great software.
gravatar
Mark
Restarting my python runserver fixed the problem. Feel free to delete my useless comment if you'd like :) Yay!
gravatar
Will McGugan
Hi Mark, No worries, let me know when its online!
gravatar
Ramiro Algozino
Hello Will!
I really like this, do you know if it will work on an alwaysdata free account?