Blog posts tagged with: django
News and other things I find interesting
RSS feeds and ATOM feeds

Django tagging
Last modified: Sunday, July 18, 2010
I added tags support for my blog posts via using the Django tagging library. As you can see each blog post now has any number of tags associated with them.
Overall Django tagging works a lot like Django comments in that you can attach tags to any model in your project.
To implement Django tagging inside my site, I did need to make a slight model change to have a tags field in my blog news item table. Apparently this field is only used for caching and so that it shows up in the Django administration. When you modify your model in Django administration a new text field appears labeled Tags that you can enter in space separated tags for your model.
I made each tag into a link which bring you to all posts on the site about the specified tag. Also you can find a Tags link on the right hand bar which displays the list of tags in use and how many posts each tag has.
The Django tagging framework has many other features which I didn't use, but from what I used it's a great and very easy to use library.
Django Comment Framework
Last modified: Saturday, July 17, 2010
I've implemented comments on this site for all blog posts. I've been wanting to add comments for a long time, especially in case I have errors in any of my postings.
I decided to build off of Django's built in comment framework django.contrib.comments. I was very impressed on how easy it is to integrate and customize. The Django comment framework allows you to attach comments to any model you have. So I didn't need to do any additional database work.
I'm going to attempt to hold off on CAPTCHA for the moment to see how their honeypot feature works. But I expect that I'll have to implement a CAPTCHA system eventually. Basically the honeypot feature is an extra field in the form that's used as a trap. If any data is entered in that field, the comment will be considered spam. Spam robots will typically fill out all fields when attempting to make a form submission.
The sliding and collapsing effects are basically done with a single line of jQuery code.
$("#id-of-div").slideToggle();
You can also optionally pass in a duration or 'fast' and 'slow' keywords to the slideToggle function. Some other cool cross browser things you can do with jQuery are: adding animated effects, Making XML HTTP (AJAX) requests, DOM navigation, DOM manipulation, drag and drop, complex client side operations, and validation.
|
Brian R. Bondy on
Friday, July 09, 2010 (10:07:18) says: |
The new site is out!
Last modified: Saturday, July 17, 2010
Several months ago I decided that this website needed a revamping.
The work since that thought is finally being released today. The work on the site is still slowly in progress, but I feel that enough of the site is done to be better than the last site.
Some stats on the new site:
- Was developed on my mac
- Was written using vi for all editing
- Was built using Django 1.1
- Is running with Python 2.6
- Is served through IIS with PyISAPIe. (PyISAPIe is a great project created by Phillip Sitbon which brings Django to IIS.)
- JQuery was used for a couple of post page served alterations
- The database is built using SQLite
- The blog posts with code samples are made with Google's code prettify
- All blog posts are rendered using Django Markdown (which makes for easy posting of great content)
Markdown is a hassle free, easy to use markup language that allows you to easily post links, post images, and format great blog posts with little work.
The old site was built in ASP .NET beta, and slowly upgraded over time to newer versions. Overall for me, coding in Django is a much better and funner experience than coding in ASP .NET ever was.
Before deciding on Django for the new site, I also had an attempt at Ruby on Rails. I wasn't a fan from the start, the language was simply too different from what I am used to and know.
I like the new design a lot better than the old one. I hired Bradd Bezaire to do this design over 2 years ago in August of 2007. This design sat in my inbox since then because I've been extremely busy, but I'm glad his work didn't go to waste after all.
PyISAPIe with Django 1.1 and Python 2.6
Last modified: Saturday, July 17, 2010
The PyISAPIe help files currently claim you have to use Python 2.5 and uses Django pre 1.0.
But with some small changes to one of the config files, you can actually have Django 1.1 and Python 2.6.
The only change from their help file that you need to do is replace their pyisapie.py with this file that I modified.


