Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
See Spot Test Django
Here is some “science fiction” I’m working on at the moment for testing the Django admin app with Selenium. I call it science fiction because the I’m still working on the code that will actually read this and execute it correctly in the browser. I imagine the source document will be HTML with a scent [...] -
Django/AJAX Beating
James Bennett is taking a bit of a beating for his Django/AJAXsuggestions. A lot of the criticism is unmerited Rails envy, I imagine. Rails has RJS — great! Django is not Rails.If you want to build more than toy apps, you'll need something more sophisticated than these little server-side helper functions. And if you just want partial page updates or DHTML UI tricks, any JavaScript toolkit can make this quick and painless for you.I also don't see why when someone says "Django's AJAX support shouldn't look like RJS," people hear, "Django isn't going to include AJAX support." AJAX, for all it's usefulness as a term, is used in many different ways. I think the confusion in this case is due to the same word being used to mean two completely different things. -
New Job with Naples Daily News
I've taken a new job with Naples Daily News. I'll be a developer in the new media department building cool stuff with Django. I'm excited about the work and about working with Rob Curley, Eric Moritz, and the rest of the team.I'll still be Alabama working from home, being that I just bought a house 3 months ago. I'll travel a bit more now, making monthly trips to Naples, which is a really beautiful and interesting city.I think this is one of the best moves I've ever made. When I first started working with Django, I was so impressed by what I heard about World Online and really wanted to be doing the same kind of work and be in the same kind of environment. Now, I get that chance. How cool is this!I finish at the library on Tuesday, July 11, and start work with Naples News the next day. -
Now Django Powered
I finally got this site converted to Django, more or less. There are a few static pages lying around, but on the whole, I'm Django powered now. It was quite a hack job, of which I'll (maybe) relate later.My hosting service Jump Domain doesn't really advertise Python or Django support. It can be done, though it's probably not for the faint of heart. Scott with Jump Domain has been ultra helpful and I'll try to talk with him more about what can be done to improve support for Django and Python. -
Improved text image view
I just found this in my django-ego-feed: 23 excuses: Simple Django View for Dynamic Text Replacement I’ve been using something similar to generate the titles for the site (look at the title above for an example), so I’m pretty familiar with the technique. Andrew’s code over there is pretty good, but I’ve got a few improvements he and you might be interested in: The business to writing to a temp file is ugly and will break as soon as you get two simultaneous requests. -
Django OSCON shirts
I’m about to print up some Django shirts to take to OSCON next month – got any ideas? We gotta move pretty fast (we’re going to try to get an order in to the printer this week) so if you’ve got any hot ideas (or designs, for that matter) send ‘em to me! I’ll mail anyone who gives an idea or a design one of the final shirts, but otherwise please don’t ask about “ordering” or otherwise “getting” one. -
Using Django's TemplateTags
I've had a number of e-mails about how I include the listing of blog tags and archives by month on the side of my website from people who have obviously built up a blog and now want further integration with their website. Well, it's ultra-simple thanks to a nifty Django feature called template tags. The concept behind template tags is simple - a quick snippet of code in your page templates calls some python code behind the scenes, which does some stuff, and returns either raw HTML code (yuck) or sets new variables in your template context, allowing you to manipulate and display them as you please (cool!) To get started, in the application directory for your blog, create a directory named templatetags and place an empty file in it, named init.py. Now, create a file - in this case we'll call it blog_months.py. We need to do a few things in this file: Import the relevant models so we can access the data Create and register new template tag Write the function(s) for that tag so they add data to the template's context. The contents of this file need to be: from yourproject.blog.models import Tag,Post from django.template import Library,Node … -
Using Django's TemplateTags
I've had a number of e-mails about how I include the listing of blog tags and archives by month on the side of my website from people who have obviously built up a blog and now want further integration with their website. Well, it's ultra-simple thanks to a nifty Django … -
"Show and tell" this Thursday
This Thursday, the basement at our Greenpeace headquarters will be filled with Ruby and Django folks, coming for a "show and tell" meeting to talk about their projects. From 14:30 until 16:30 there will be six short talks with Q&A;, including Ximon explaining how we work with Ruby here. In the meantime, we're coming close to the "show and tell" phase of our platform. The last "blocking issues" for a first live release are being solved this week, and we're making progress with a design overhaul. OF course, that leaves us with only a million or so new ideas to develop on the platform, so we're also moving the open source side of the platform to a new platform to open it up for more people to contribute. Keep an eye on this blog, or get in touch with me if you can help us! (rolf.kleef (at) int.greenpeace.org) -
"Show and tell" this Thursday
This Thursday, the basement at our Greenpeace headquarters will be filled with Ruby and Django folks, coming for a "show and tell" meeting to talk about their projects. From 14:30 until 16:30 there will be six short talks with Q&A, including Ximon explaining how we work with Ruby here. In the meantime, we're coming close to the "show and tell" phase of our platform. The last "blocking issues" for a first live release are being solved this week, and we're making progress with a design overhaul. OF course, that leaves us with only a million or so new ideas to develop on the platform, so we're also moving the open source side of the platform to a new platform to open it up for more people to contribute. Keep an eye on this blog, or get in touch with me if you can help us! (rolf.kleef (at) int.greenpeace.org) -
"Show and tell" this Thursday
This Thursday, the basement at our Greenpeace headquarters will be filled with Ruby and Django folks, coming for a "show and tell" meeting to talk about their projects. From 14:30 until 16:30 there will be six short talks with Q&A, including Ximon explaining how we work with Ruby here. In the meantime, we're coming close to the "show and tell" phase of our platform. The last "blocking issues" for a first live release are being solved this week, and we're making progress with a design overhaul. OF course, that leaves us with only a million or so new ideas to develop on the platform, so we're also moving the open source side of the platform to a new platform to open it up for more people to contribute. Keep an eye on this blog, or get in touch with me if you can help us! (rolf.kleef (at) int.greenpeace.org) -
Picked to present Selenium at Google’s Conference on Test Automation
Woo-hoo! I just got an email from Allen Hutchison at Google that my presentation proposal has been selected for Google’s London Test Automation Conference. Here’s a short excerpt from my proposal: In my talk, I would explore the use of Selenium in a fully integrated “web testing appliance” setup. With Selenium, some clever Python scripting, [...] -
TECHcoffee update – it’s on…
The first TECHcoffee will be on Monday, June 19th, 6-8 a.m. in the Loop. location: Caribou Coffee (Northwest corner Lake/La Salle) -
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 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 … -
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 … -
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 [...]