Freelancers and Django (DRY-Principle)
In Django you are able to write websites in a minimum of time with a great result. Some developers, nevertheless, don't care about structuring their source as good as Django does. This will cost time and nerves. This entry is meant to show how especially freelancers can save time by thinking before programming, what is a good overall rule. ;)
Two main kinds of Django developers
There are developers, who work only on one project. They use Django to be able to concentrate on the real programming and not too boring stuff, like creating comments and so on. I'll ...
Django Development Version on Windows
I work with the Django development version on my (linux) server. But I work with a Windows Operation System, which is very dump when it comes to SVN Checkouts. There are some solutions for the command line. Hey, honestly the windows command line is annoying, isn't it?
TortoiseSVN
TortoiseSVN is a very easy to use tool for windows, which enables you to download the current Django Development Version.
Installing TortoiseSVN
Go to the TortoiseSVN Download page and select the MSI-file, which fits your windows. Installing is very easy:
- Click "Next >" twice
- Deselect "Additionally Icon set", "..(GB)..", "..(US).." by clicking ...
Table of Contents: Django Template Filter
I always loved being able to link back a certain chapter of a webpage. Sometimes it is great to just link to the source code of a weblog entry or any other part of it. To enable the visitors of my weblog to do that I wanted to set up some kind of Table of Contents.
I wanted it to be flexible, so that I can adjust whether the table of contents is shown or not. This makes sense, because some articles have just two headlines and a table of contents with two points looks pathetic. So the users would ...
Django signals vs. custom save()-method
The more I read about Django signals (didn't set up one yet), the more I wonder where the difference between a post_save or pre_save signal and the redefinition of the save-method is.
Background Knowledge
In case you know what signals are and you know what I mean with the redefinition of the save-method, skip the following paragraphs.
Sorry, but what are signals?
Signals are actions, which you can listen to. When you, for example, want to get an email the next time someone writes a comment (commonly some spam-robot, but anyway), then you can write a small piece ...
Adding archives information via Django templatetag
It is quite typical for Wordpress-blogs to have all archives in the sidebar. For example "August 2005, September 2005", all linked back to the archives pages. Django, sadly, doesn't have something by default to generate these archive links dynamically.
There is another reason, why people, should want this ability, even though they don't want these links in their sidebar: the <link rel="archives" />-tags. In case you're not interested in this HTML-tag, just ignore the following paragraphs and skip directly to the source code.
<link rel="archives" />-HTML-Tag
I love one special little HTML-Tag, which isn ...
Markdown with syntax highlighting in Django
These days I wrote my first Django project (you are currently browsing it). Of course I wanted to post entries into this blog with code snippets. To make the reading experiance better for my readers I decided to use a syntax highlighter. You find thousands of them around the WWW.
The first try: syntaxhighlighter with tiny_mce
I decided to use syntaxhighlighter, which is purly JavaScript-based, so I didn't need to anything. (I was glad, because I was, and still am a Django and Python newbee.) The only thing I had to do was to use either of this to ...
Breadcrumbs in Django with Templates
One great feature of a well-structured website is the navigation bar or location bar, better known as breadcrumbs. It always tells the user, where exactly s/he is currently on the website. (On the website you are currently browsing it is located above the footer, called 'Your way'.)
As a matter of fact, this bar never was easy to create. But when you use Django you don't need one single line of code to achieve your own breadcrumb navigation bar.
A Good Template Structure is the Key
Like everything in Django, you have to consider before you do something ...
Problems installing (easy_install) PIL
One very basic Python library is PIL (Python Imaging Library). It is used for image manipulation.
To install packages, I usually use easy_install, but installing PIL using this tool, I got an error:
:~#easy_install PILSearching for PILReading http://cheeseshop.python.org/pypi/PIL/Reading http://www.pythonware.com/products/pilReading http://effbot.org/downloads/#ImagingReading http://cheeseshop.python.org/pypi/PIL/1.1.6No local packages or download links found for PILerror: Could not find suitable distribution for Requirement.parse('PIL')Fortunately, I found someone, who shared my problem, so this is the way ...

