Articles tagged as “django”

How does the Django Cross-site request forgery protection work?

Dan Poirier wrote an article on the Caktus Group blog about common web site security vulnerabilities. In it he talked about the CSRF protection in Django. Although he is right about a CSRF token having to be part of the POST request, this is not the entire story.

Sending emails with embedded images in Django

Django offers useful classes to easily send email. It is also easy to add attachments to emails. I did have to puzzle a bit to get embedded images working. This article describes the way I do it now. I will first describe the most important elements and then I will show a more complete example.

Migrating django.contrib.comments to Disqus

As of today I am using Disqus for comments on this site. This meant that I had to migrate the old comments (which used django.contrib.comments) to Disqus. Here’s a short description of how I did this.

Whiskers and buildout.sendpickedversions

Last year I participated in a deployment knowledge sharing session and I started implementing changes at my company pretty soon after. The result is that we are using Puppet for some parts of our server configuration. We also added Munin to our monitoring toolset (and I used Puppet to deploy Munin and manage its configuration). But an important piece that was still missing in our setup was an overview of which packages we use in the buildouts of our clients and more specifically which version each client uses.

Using a jQuery plugin in Django admin and getting a “$().foo is not a function” or “Object ... has no method foo” error?

Are you using a jQuery plugin, for instance jQuery UI, to spice up the Django admin site? Then you might get either an error like “foo is not a function” (Firebug) or “Object … has no method foo” (Chrome Developer Tools). Confused because foo should be defined in the plugin? Don’t worry, the solution is simple.