Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Back online and moving ahead
Last Friday we had a problem with our development server, and so our Melt instances were unavailable for a while. Yesterday, a disk change in that server caused some more downtime, but things are back up again. In the meantime, it has been a bit quiet here on the blog, while work was progressing. The naming and design are moving forward, and we should have final versions and be implementing the design in our templates soon. And... we now have the Melt project space at Sourceforge (thanks for your help, Misha!), so our software will become available through the new Sourceforge Subversion system. -
Sending E-Mails via Templates
So you've got an application written in Django that needs to send large bodies of e-mail, but you don't want the e-mail message itself to be in your Python code. Fair enough, I'd say - you should be separating form from function, and in this case, the e-mail output is still … -
Sending E-Mails via Templates
So you've got an application written in Django that needs to send large bodies of e-mail, but you don't want the e-mail message itself to be in your Python code. Fair enough, I'd say - you should be separating form from function, and in this case, the e-mail output is still what I'd classify as 'form'. One way to tackle this situation is to create a template for your e-mail body, process that template to fill in the gaps (eg Username, URL's, etc) and shoot it off via Django's e-mail functions instead of rendering it in a web browser as you'd normally do with templates. First things first - create your template. In this case I'm writing an e-mail to a user thanking them for registering on a website. I've put the template in my templates directory, called email.txt in the registration subdirectory. Dear {{ name }}, Thank you for signing up with {{ product_name }}. Your new username is {{ username }}, and you can login at {{ login_url }}. Once logged in, you'll be able to access more features on our website.. We hope that {{ product_name }} is of good use to you. If you have any … -
Bad dog!
So I came home to find this: [A moment of silence for my so-recently-new toy…] He mangled the thing pretty good, but amazingly it still turns on, albeit with a busted touch-screen. However, Nintendo’s customer service provides a happy(ish) ending to this story. Here’s a rough version of my call to Nintendo: Nintendo: Nintendo of America! This is —-, how may I help you? Me: -
Cyclomatic complexity of Django
Adrian’s recent post on the dev mailing list about the code within django.db.models got me remembering some other “monstrous” functions I’ve seen while browsing the Django source. Guess no more as to the most monstrous functions of Django because below are the results of my previously posted complexity.py script when run on the Django source. [...] -
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 …