Tag programming
How I Moved My Commercial Projects to Newforms-Admin
Django 1.0 Alpha is out, and with it come some major API changes to Django's internals. This means you need to make a number of changes to your Django projects before upgrading Django to a recent copy. I've got a handful of commercial and public-facing websites running on Django, so I decided now is a good time to upgrade them.
Django 1.0 Alpha Released
Django, my web development framework of choice, has reached Alpha 1.0. There's a bunch of Backwards Incompatible Changes to the API which will require changes to your projects, but the codebase should be pretty stable from here to 1.0.
The biggest changes to this from the last official release are 'Unicode everywhere', a new and more powerful admin module powered by newforms, an updated database ORM that's more efficient, and automatic escaping in templates to help reduce the risk of cross-site scripting attacks.
1.0 should be released with a party at DjangoConf 2008 on September 2nd - I look forward to it (Although I won't be at DjangoConf, unfortunately).
Great work to everybody involved!
http://www.djangoproject.com/weblog/2008/jul/21/10-alpha/My DebugBar / CompanionJS
CompanionJS is a javascript debugger for Internet Explorer, somewhat similar to FireBug for Firefox. Looks like it'll be a useful tool for finding & fixing JS bugs in IE prior to deploying projects, as like most web developers IE isn't exactly my browser of choice.
http://www.my-debugbar.com/wiki/CompanionJS/HomePageYahoo! Address Book API is Available
Yahoo! have released an API to allow applications to access users address books without asking for a username and password. These API's are slowly becoming more and more available from various data providers, and it's a great way of breaking the scarily traditional "Enter your username and password so we can fetch your contacts" process.
Now all we need is a Python interface to it :)
http://developer.yahoo.com/addressbook/Google Code begins hosting AJAX Libraries
Google are using their CDN to host a number of Javascript libraries (including jQuery, prototype, and others). This means that a browser should only have to download the code once, rather than once for each site they visit that uses it.
You can link directly to the .js files, or use a Google API call to always load the latest version of a library.
http://code.google.com/apis/ajaxlibs/Google Code: Google Contacts Data API
The Contacts Data API allows client applications to view and update a user's contacts. Contacts are stored in the user's Google Account; most Google services have access to the contact list.
Your client application can use the Contacts Data API to create new contacts, edit or delete existing contacts, and query for contacts that match particular criteria.
http://code.google.com/apis/contacts/developers_guide_protocol.htmlQueryset-refactor branch has been merged into trunk
Malcolm Tredinnick's fantastic work on the Queryset Refactor Branch in Django is coming to a close.
This mammoth change alters the way Django interacts with the underlying databases to improve the queries that are built and make future additions easier. Malcolm (and, I assume, many others) have spent over half a year getting this re-factoring done. Well done to all involved!
http://groups.google.com/group/django-users/browse_thread/thread/f4cd02d8d9389669Django Dash Registrations Open
The Django Dash competition has opened registration - you've got to get in before May 24th to be able to partake in the event which will run over the weekend of May 31st to June 1st.
I've registered, hoping that I will have nothing on that weekend!
It also looks like they've done a great job getting a few big-name sponsors - this should be some good fun.
http://www.djangodash.com/registration/Better the Devil You Know (Jutda Blog)
I've just put this post up on the Jutda blog, discussing the choice of technology when it comes to building a new product within a startup company. My main point: Use tools you know well rather than trying to learn as you go - your final product will be better for it.
http://www.jutda.com.au/blog/2008/apr/devil-you-know/Django Dash
This is a great idea that should see Django developers from all over the world compete to produce a fantastic Django application in only 48 hours.
This puts real emphasis on Django's origins as a framework for perfectionists with deadlines. The aim is for small teams to build applications, from scratch, in a tight timeframe.
No word on whether there is a particular focus yet, and no details on sponsors and judges just yet, but this looks like it'll be great fun for those who are into this sort of thing (and, of course, those able to compete at the exact point in time when the competition is open!)
http://www.djangodash.com/Jutda: Django-powered Solution Provider
In my previous post I mentioned Jutda, a Django-powered company that I'm working on in my spare time. I would now like to formally introduce Jutda to the Django community and outline a few exciting projects that are on their way. World, meet Jutda!w
Overdue Catchup
A quick update on a few projects including DjangoSites, WhisperGifts, Jutda, a Django-powered Forum package, and my OpenID implementation.
Django Menuing System
Although Django's template system is very easy to get the hang of, it's not for everybody. In particular, it's not for people whose job it is to publish content without having any technical know-how. For this reason, I'm giving away a simple menuing application for Django that lets your content editors addand change menu items without bothering your template authors.
DjangoPoweredSites Grows Up
I've spent some significant time over the past weekend moving website listings from the old DjangoPoweredSites wiki page to DjangoSites. That brings the total number of Django-driven websites listed to over 800! We'll now close down the wiki page as it has become redundant, but require a little bit of help cleansing the new list.
Easy Multi-Part E-Mails with Django
Django provides an easy way to send multi-part text/HTML messages. I've recently built on top of this existing framework to provide an ultra-easy way to send templated HTML and plain-text messages with minimal code duplication.
Django: Multiple Aliases for a Single Website
In these days of cheap domains, it's often desirable to own multiple domains for a single website. You've probably got each of the .com, .net and .org domain names, along with a country-specific domain. You want each of these to present exactly the same website to the world, but good design says that each web page should have one, and exactly one, URL. So what's the best way to serve this up without having an Apache config for each domain?
Mixing OpenID into Django's authentication system
OpenID is a de-centralised authentication system that is making a splash in a big way. In this post I give an overview of what OpenID is, and how I'm going about integrating it with Django's user-management / authentication system.
Validating a Username via jQuery with Ajax
The phrase 'simplifying the user experience' (or it's cousins) is thrown around regularly these days, without many examples on HOW to actually make life easier for the end user. In my opinion it's about removing needless junk wherever possible, letting the user focus on what's actually important. A simple example I've extracted from a current project is minimising needless page loads. Read on to find out how I validate availability of a username during the Django registration process.
DjangoSites: We Want YOU!
We're at 260 sites listed on DjangoSites. The DjangoPoweredSites page has 3-4 times that number - so if you've got a website built with Django, why not submit it (for free, no less) and show it off to the world?
Djangosites Updates
Djangosites.org was launched last week as a new way to show off the many websites that are built with Django but that don't get much fanfare within the community as they aren't technology based. I've received some fantastic feedback from the community so have improved the RSS feeds and access to info about source-code.
Introducing Djangosites.org
Over the past few weeks I've been working on a website to allow the Django community to showcase what's out there that's built using the fantastic Django framework. With input from others in the community, the site is now live. I introduce to you, DjangoSites.org
Using The WebThumb API with Python
There is a fantastic free service available to create screenshots of websites using an API at bluga.net. The problem is, there are no samples in Python. As part of a project I'm working on with the Django community, I've written a simple Python interface to the bluga.net webthumb API which lets you pass in a URL and receive back a screenshot.
Using Subdomains with Django
Sometimes it's really handy to give users their own sub-domain, especially when they're uploading their own content to your Django application. I've done this for a few private projects so far, and it's really quite an easy way to give people an extra level of customisation in your application - it also allows you to make even more beautiful URL's that you might otherwise be doing.
Helping Sort Django's Error Emails
Running multiple Django sites, all with debugging disabled? Getting confused as to which traceback emails belong to which site? This simple Django tip shows how to alter the e-mails being sent by Django so you can more easily work with these e-mails which are a very useful site management tool.
Blog Spam Protection
I've made a small change to my blog to try and slow down the spammers a bit - the first step in a few that I have planned.
Simple Javascript Spell Checking
In a project I've been working on lately, it's been an important requirement to allow users to spell-check the text they're entering, as it's going to be seen by their family and friends. I spent a bit of time looking at different spell-checking options, which ranged from simple checkers to what seemed to be complete working realtime MS Word™-style spell checkers with underlining and right-click support. In the interests of keeping everything simple to use and as cross-browser as possible, I've settled on a simple yet elegant solution.
The Pareto principle (Or, why the 80/20 rule always bites us in the ass)
There is a common saying that 80% of a project takes 20% of the time and budget - and the remaining 20% of the work takes 80% of the time. This is no more correct than in the software development environment. Warning: Rant ahead!
ChangeManipulators on only part of a model
There is a cool function in Django for managing forms, and automatically doing data validation and manipulation before updating the database. That same cool function also has a critical issue in it that makes it impossible to reliably only update part of a model - except that critical issue has a critical fix that has been around for almost a year now and has never been documented.
Housekeeping
I've done some minor changes to the website recently to make life easier - including a new website template.
Sending E-Mails via Templates
Django's templates are fantastic for displaying content on your website, but what if you could use the power of the template system in other areas, such as e-mails sent from your application for registration or update purposes? Well, you can do just that - read on for an example.
Using Django's TemplateTags
Often times on a website you will want to include the same block of dynamic data in your template, regardless of the view that generated the page. Common examples are lists of tags or categories, navigation bars (built from the database) and other such lists - such as those on the right side of this page. The good news is that you don't have to modify every single view to add these details to the template context. The better news is that it's fantasmically powerful with Django.
A Django Blog: Redux
A recent upgrade to Django has made some drastic and far-reaching changes, called 'Magic Removal'. As such, all earlier code that relies on Django has to be updated - including my blog tutorials. Read on for a summary of the changes you'll have to make.
XSS Vulnerability
Simon Greenhill, a New Zealand based programmer, has alerted me to a cross-site scripting (XSS) vulnerability in the comments portion of my blog - that seems to extend to the comments module in ALL django applications.
Django: Magic-Removal Upgrade
I've updated my websites to run on the latest Django code base, named 'magic removal'. The updated blog code is coming soon, as it has to be altered in many ways to make it work on the new code. This should be the last major base change to Django before their 1.0 release.
Building A Blog with Django #3
The third portion of my series on building a weblog application with Django: learn how to add the global Django comments module to your application, and list all posts for a given tag.
Building a Blog with Django #2
The second part of my 'Building A Blog with Django' series, showing how to actually make your database visible to the world - you'll be putting your weblog online for all to see. See part 1 for information on creating the database.
Django: My First Impressions
I've always been a PHP coder - everything web-based that I wrote was in PHP. Until last week. I've discovered Django, and I'm wishing I found it earlier. And why haven't I been using Python until now? Read on for my first impressions of the Django web framework.