Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Admin interface for a Blog in 5 mins
It's so cool with Django: from django.db import models from django.contrib.auth.models import User class Tag(models.Model): name = models.CharField(maxlength=200, core=True) class Admin: ordering = ['name'] def __str__(self): return self.name PUBLICATION_CHOICES = ( ('Draft', 'Draft'), ('Published', 'Published'), ) class Post(models.Model): author = models.ForeignKey(User) title = models.CharField(maxlength=200) summary = models.TextField() body = models.TextField() created = models.DateTimeField(default=models.LazyDate()) last_modified = models.DateTimeField(auto_now=True) enable_comments = models.BooleanField(default=True) tags = models.ManyToManyField(Tag) publication = models.CharField(maxlength=32, choices=PUBLICATION_CHOICES, radio_admin=True, default='Published') class Admin: ordering = ['-created'] search_fields = ['title'] list_display = ('title','author', 'created') list_filter = ('created','last_modified','enable_comments','publication', 'tags') def __str__(self): return self.title class Comment(models.Model): post = models.ForeignKey(Post) name = models.CharField(maxlength=100) email = models.EmailField() website = models.CharField(maxlength=200, blank=True, null=True) comment = models.TextField() created = models.DateTimeField(auto_now_add=True) last_modified = models.DateTimeField(auto_now=True) class Admin: ordering = ['-created'] search_fields = ['name'] list_display = ('post','name', 'created') list_filter = ('created','last_modified') def __str__(self): return self.name -
Django Admin interface for a Blog in 5 mins
It's so cool with Django: from django.db import models from django.contrib.auth.models import User class Tag(models.Model): name = models.CharField(maxlength=200, core=True) class Admin: ordering = ['name'] def __str__(self): return self.name PUBLICATION_CHOICES = ( ('Draft', 'Draft'), ('Published', 'Published'), ) class Post(models.Model): author = models.ForeignKey(User) title = models.CharField(maxlength=200) summary = models.TextField() body = models.TextField() created = models.DateTimeField(default=models.LazyDate()) last_modified = models.DateTimeField(auto_now=True) enable_comments = models.BooleanField(default=True) tags = models.ManyToManyField(Tag) publication = models.CharField(maxlength=32, choices=PUBLICATION_CHOICES, radio_admin=True, default='Published') class Admin: ordering = ['-created'] search_fields = ['title'] list_display = ('title','author', 'created') list_filter = ('created','last_modified','enable_comments','publication', 'tags') def __str__(self): return self.title class Comment(models.Model): post = models.ForeignKey(Post) name = models.CharField(maxlength=100) email = models.EmailField() website = models.CharField(maxlength=200, blank=True, null=True) comment = models.TextField() created = models.DateTimeField(auto_now_add=True) last_modified = models.DateTimeField(auto_now=True) class Admin: ordering = ['-created'] search_fields = ['name'] list_display = ('post','name', 'created') list_filter = ('created','last_modified') def __str__(self): return self.name -
TECHcoffee – “running club” meets “study hall”
On Friday, I posted a message to the Chicago Python list about the possibility of doing weekly code sprints. excerpt: “… which got me thinking even more… what if every week there was a “mini-sprint” held at some central location downtown where folks can meet up and code. Kind of like a running club, but for [...] -
Selenium – making a dent in the universe and getting paid to do it…
Woohoo! I just discovered today that Selenium, the nifty web testing tool, now has its own page on Wikipedia. Okay, since anyone can edit Wikipedia, that’s not much of an accomplishment. But I promise I didn’t make the edit myself. I am amused, though, that Selenium (the software) is relevant enough now to warrant a [...] -
A Django Blog - Redux
At the start of May, the Django magic-removal branch was merged with 'trunk' - the mainstream Django code base. While this branch isn't yet available for download by the lay user, it's there in svn ready to be checked out and used, and it seems quite stable - the djangoproject.com website … -
A Django Blog - Redux
At the start of May, the Django magic-removal branch was merged with 'trunk' - the mainstream Django code base. While this branch isn't yet available for download by the lay user, it's there in svn ready to be checked out and used, and it seems quite stable - the djangoproject.com website was recently moved across to that very codebase. All of the documentation on djangoproject.com refers to the MR codebase, and because trunk had been updated it meant if I wanted any updates to Django (I run off of the SVN codebase, not the mainstream download) I'd have to go MR. With the 'RemovingTheMagic' wiki page open in one brower screen, I got to making the required changes in another screen. What you're seeing here is the end result of that. As such, most of the code has changed. Instead of writing a blog entry with a few hundred lines of python code, I've put it all in an archive you can download from my site. This code is released under a Creative Commons License, as linked with the button on the right side of this blog. Please respect this license - it's very generous. I just want this code … -
XSS Vulnerability
A week or so ago I received an e-mail from a nice new zealander, Simon Greenhill, alerting me to a cross-site scripting vulnerability in the comments portion of my blog. The vulnerability will actually probably be of concern to anybody using the comments module from Django - I haven't dug far enough into it as yet to confirm exactly what's at risk. If you read on, you can see the contents of the e-mail he sent through to me. Basically, the 'name' field from the comments needs to be escaped at the time when the comment preview is displayed. I patched my code some time ago, but now I've got the chance I'm making it public to help everybody else out. His e-mail said this: However - I've noticed one problem - your comment preview form is at risk of XSS. If I enter javascript into the name field ( e.g. <script>alert( 'hi');</script> ), it'll be executed. Easily fixed escaping - change this line: <p>Posted by <strong>{{ comment.person_name }}</strong></p> to: <p>Posted by <strong>{{ comment.person_name|escape|urlizetrunc:"40"|linebreaks }}</strong></p> If this isn't caught at the preview form stage, then it's going to affect your comments listing too since, again, comment.person_name isn't escaped. The things … -
XSS Vulnerability
A week or so ago I received an e-mail from a nice new zealander, Simon Greenhill, alerting me to a cross-site scripting vulnerability in the comments portion of my blog. The vulnerability will actually probably be of concern to anybody using the comments module from Django - I haven't dug far … -
Setting up tools 2
This is the 2nd part of Setting up tools on Windows — notes mostly for myself. (No, I don't run Django with MSSQL under IronPython. Yet.)In this installment I add more stuff to Eclipse, and set up my apps under FastCGI on Linux-based shared host (I use DreamHost).EclipseThis section was updated on 9/30/2006. I already set it up with PyDev and Subclipse. Now I want to add HTML/CSS editing. And I want to do AJAX.Run Eclipse and go to Help -> Software Updates -> Find and Install....Select Search for new features to install and hit Next.Select "Callisto Discovery Site", click Finish, and wait.Select WST (it's under "Callisto DiscoverySite" => "Web and J2EE Development"), click Select Required to make sure you selected all components (it will add GEF and some other components).Click Next, accept licenses, click Next, and Finish to install all components. Eclipse Web Standard Tools take care of everything but their JavaScript support is not what I consider "good". I need to install one more plug in, which will help me with Dojo-based Ajax: JSEclipse. This plug-in used to be not free for commercial development. Now, when InterACT was bought by Adobe, it appears to be free. The latest version … -
NetSquared Online Sessions
I am in San Jose now, just a few hours away from the opening reception of NetSquared, probably the biggest "Web 2.0" conference I will be attending for a while, with some 350 participants expected. Many many interesting talks and sessions proposed, including a parallel online event, with two important items. Tuesday 30th May, 11AM PST (which is 8PM Western Europe, 7PM UK, 6PM UTC) I will have an hour session on our Custard Melt project, and especially on what our ambitions and expectations are. I hope that many people will join to explore how we can make the online platform help in galvanising offline action. At 4PM PST, 1AM Western Europe, midnight UK, 11PM UTC, Micki Krimmel of Participant Productions will be online for a session on "Media that Mobilizes: An Inconvenient Truth, ClimateCrisis and more tales from Participate.net". Of course, as the producers behind Al Gore's movie about climate change, this is of particular interest to us. -
NetSquared Online Sessions
I am in San Jose now, just a few hours away from the opening reception of NetSquared, probably the biggest "Web 2.0" conference I will be attending for a while, with some 350 participants expected. Many many interesting talks and sessions proposed, including a parallel online event, with two important items. Tuesday 30th May, 11AM PST (which is 8PM Western Europe, 7PM UK, 6PM UTC) I will have an hour session on our Custard Melt project, and especially on what our ambitions and expectations are. I hope that many people will join to explore how we can make the online platform help in galvanising offline action. At 4PM PST, 1AM Western Europe, midnight UK, 11PM UTC, Micki Krimmel of Participant Productions will be online for a session on "Media that Mobilizes: An Inconvenient Truth, ClimateCrisis and more tales from Participate.net". Of course, as the producers behind Al Gore's movie about climate change, this is of particular interest to us. -
Django And The Disappearing Template Tags
If you are defining custom template tags, don’t put them in a file named log.py. You’ll be able to {% load log %} fine in your template, but you won’t be able to use your tags. No, this isn’t documented anywhere. I suspect it’s because the admin interface also defines custom tags in a file [...] -
World Cup on your Palm
A bit off-topic, but for those of you (like me) with a Palm-OS-based organiser: if you want to have the schedule of all World Cup matches available, keep track of scores, add the matches to your agenda, and even download them wirelessly, you might want to look at SK7Software's "World Cup 2006". They give the software away for free, but ask you to take action against climate change, refering to our colleagues at WWF in the UK. -
World Cup on your Palm
A bit off-topic, but for those of you (like me) with a Palm-OS-based organiser: if you want to have the schedule of all World Cup matches available, keep track of scores, add the matches to your agenda, and even download them wirelessly, you might want to look at SK7Software's "World Cup 2006". They give the software away for free, but ask you to take action against climate change, refering to our colleagues at WWF in the UK. -
World Cup on your Palm
A bit off-topic, but for those of you (like me) with a Palm-OS-based organiser: if you want to have the schedule of all World Cup matches available, keep track of scores, add the matches to your agenda, and even download them wirelessly, you might want to look at SK7Software's "World Cup 2006". They give the software away for free, but ask you to take action against climate change, refering to our colleagues at WWF in the UK. -
News sites that don’t suck
I sure wish there were news sites in my city that didn’t suck. How happy I would be if I could have sites such as the Django-powered 49abcnews or LJWorld to give my attention to each evening. Instead, I’m stuck with crappy news site after crappy news site after crappy news site. Popups, popovers, registrations, [...] -
New spreadsheet
Getting back underway has seen my faithful project management spreadsheet undergo something of an upgrade. First Tim (our new lead at ThoughtWorks) added a number of tabs for tracking individual iterations and graphing our velocity - which will be interesting to watch as the new guys get up to speed. Secondly I split out the non-functional stories onto a separate tab, since I've never felt quite comfortable having things like 'Must use standards compliant xHTML' sit next to 'Should be able to order search results alphabetically', it just didn't seem like we were measuring the same things. Finally I've added the bugs we've found as stories in cases where they can't be listed directly against an existing story. I'm not sure how that's going to pan out but we'll see as we go... You can see the new spreadsheet at http://svn.greenpeace.org/repositories/custard/doc/Custard%20Master%20Story%20List.xls?rev=592 -
New spreadsheet
Getting back underway has seen my faithful project management spreadsheet undergo something of an upgrade. First Tim (our new lead at ThoughtWorks) added a number of tabs for tracking individual iterations and graphing our velocity - which will be interesting to watch as the new guys get up to speed. Secondly I split out the non-functional stories onto a separate tab, since I've never felt quite comfortable having things like 'Must use standards compliant xHTML' sit next to 'Should be able to order search results alphabetically', it just didn't seem like we were measuring the same things. Finally I've added the bugs we've found as stories in cases where they can't be listed directly against an existing story. I'm not sure how that's going to pan out but we'll see as we go... You can see the new spreadsheet at http://svn.greenpeace.org/repositories/custard/doc/Custard%20Master%20Story%20List.xls?rev=592 -
Back underway...
Following an extended hiatus the project is back in full time development. Once again the work is being done by ThoughtWorks. In addition we've engaged the services of Amsterdam based Total Identity to provide identity, look and feel and similar things for the launch. On the back end work has started on getting a production ready server set-up in place for the application. -
Back underway...
Following an extended hiatus the project is back in full time development. Once again the work is being done by ThoughtWorks. In addition we've engaged the services of Amsterdam based Total Identity to provide identity, look and feel and similar things for the launch. On the back end work has started on getting a production ready server set-up in place for the application. -
Django - Magic-Removal Upgrade
I've just upgraded Django to the new Magic-Removal code base which is now a part of the core Django distribution. I broke a few things (such as the Photo Gallery) for a few days while I ironed out a few little bugs, but all seems OK now. Soon enough I'll make available all my blog code as the tutorials published here are now basically useless due to the sweeping changes made by Magic-Removal. If anybody can suggest an easy way for me to package up my Django code to make it easily usable for others, I'd love to hear it :) I might also pull out some text from previous blog entries on using Django's contrib.comments and put them in their own article as that seems to be what's attracted a number of people to this site. -
Django - Magic-Removal Upgrade
I've just upgraded Django to the new Magic-Removal code base which is now a part of the core Django distribution. I broke a few things (such as the Photo Gallery) for a few days while I ironed out a few little bugs, but all seems OK now. Soon enough I'll … -
Google Trends – Ruby vs Python
Let a new round of flame wars begin! Google Trends – Ruby vs Python Interesting that Ruby wasn’t even on the map until early 2005. Gee, I wonder why. :-) -
Migration to magic-removal
Today I converted three web sites to the latest Django's trunk formerly known as the magic-removal branch. It was a very positive experience in general. New Database API with lazy database queries (courtesy of QuerySet) rocks! Direct interaction with model classes allows doing a lot of things much simpler than it was before. A lot of small improvements, which makes a big difference like explicit template extensions (use whatever is appropriate for your content), more transparent new Admin inner class, natural overriding of model methods (no more _pre_save() and _post_save() hooks!), and, of course, no more pluralization guessing.I encountered exactly three small problems during the conversion:RemovingTheMagic is a formidable encyclopedia of changes but it is difficult to use it as a cheatsheet for the conversion, because it is not organized by functional areas, and requires modifying files in several passes. I filed an enhancement ticket #1786.I had small problems modifying users and groups after the conversion. Instead of change screeens I started to get 404 pages without any helpful traces. I had to regenerate permission tables. An enhancement ticket #1787 shows how I did that.I found get_list_or_404() being less flexible than before. I used to pass in "__ne" and "order_by" … -
CZ: Video z Googlu o historii a vlastnostech Djanga
Letošního jara se událo hodně věcí okolo Django frameworku. Jednou z nich je konečně publikované video z Google TechTalks (26.4.2006) o přednášce od Jacoba - jednoho z core vývojářů Djanga. Ač video má něco přes 1 hodinu, doporučuji shlédnout alespoň kus. Je prostě vidět, že to tihle borci berou s humorem :)