August archive

Django roundup: August 26

August 26, 2007

  • Django sites and projects of note:
    • Satchmo is a robust web shop application written purely on top of Django. The Satchmo project hit a major milestone in its development this past week with version 0.5 (tarball) hitting the virtual shelves. Some highlights from the release notes: “100% template driven design using the django template system, integration with authorize.net, Paypal and google payment processing systems, flexible product management, PDF creation of invoices; packing slips and mailing labels, flexible tax; shipping and discount modules, newsletter management support including mailman integration, account management features” Congratulations are in order for the hard-working Satchmo team, they’ve been working on this release for quite a while!
    • Matt Waite wrote in this week about the most recently Django-powered application he’s developed for his employer, The St. Petersburg Times. It’s called PolitiFact: “It’s a Django driven take on the old newspaper “truth squad” story. We’re taking things the presidential candidates are saying during the campaign and fact checking them. All of them get put into our databases, and users can browse by all kinds of different things.” Matt has more to say about the application, PolitiFact, on his blog.
    • Justin Driscoll also wrote in about his new Django Google Code projects. The first is django-pressroom which serves as a complete public relations section for your site, complete with articles, photos, galleries, and file attachments. The next application was abstracted out of django-pressroom’s photo gallery functionality. This application is named django-photologue and should be a perfectly suitable photo gallery for any Django application you’re already working on. On what makes his applications special, Justin had the following to say: “The highlight of both apps (in my opinion) is the ability to specify PhotoSizes in the database. These PhotoSizes define the dimensions and parameters of resized copies of the uploaded image that will be generated from the source image and cached upon first request. If the PhotoSize is changed or deleted these cashed versions are removed. In addition, methods are added to the Photo model at runtime to access the cached images such as ” photo.get_mysize_url()” where “mysize” is the name of a defined PhotoSize in the database.
  • Code snippets and tutorials:
    • Joe Heck, driven by his experiences at OSCON, has developed a local queueing service in Django, django-queue-service. Joe wanted to provide a foundation for a tool that would help developers queue background tasks from their Django applications in a fashion similar to Amazon’s Simple Queue Service: “At OSCON 2007, I was hunting around for something to use to deal with background processing initiated from my web application. Not finding anything that I could immediately use and implement, I took it as a challenge to knock out something in the time I was there. The result is the django queue service.
    • Since Jacob’s initial success at getting Django installed on the iPhone, Jay Baird has been hard at work documenting the process as well as developing an application for the device: “The most intriguing [idea] to me has been the use of django as a full fledged framework for on/off-line applications where edge network usage just seems silly… I’ve been working on an online flight database for a while now and decided that it’d be cool to create an iPhone application that does the same that can sync with the main database when we become connected and want to push these records up.
    • Björn Kempén has developed a very simple middleware-based IP banning solution: “I wanted a simple way to ban users from accessing one of my django made homepages, and then having them redirected to a page with an explanation why. The IP’s and explanations should be entered through the django admin interface. For this django middleware is a decent choice.
    • If you use Mint for analytics on your site, you might be interested in Maura Chace’s post, Minty Django. Maura was interested in being able to view her website statistics along side all of the data in her custom-built Django weblog. In the post above, she details the process she undertook and the two small issues she encountered.
    • Thanassis Tsiodras has an excellent and in-depth tutorial on how he was able to build an offline Wikipedia browser using Django as the front-end.
    • Frederik Lundh moved his site, effbot.org to Django a few weeks back and has now posted some useful snippets of code that he’s developed for monitoring his memcached instance.
    • James Tinksy has posted a tutorial on paginating filtered query sets in a generic view: “I’m no Django expert. Hopefully someday I can call myself one but for now I’m stumbling through learning the basics. Most of it’s deceptively easy once you grok the concepts. You see I come from ASP classic and PHP 4 world where spaghetti code is the norm. In other words, I wasn’t groking the simple, elegance of Django.” James wasn’t kidding when he said this tutorial’s name packed a mouthful, but it doesn’t make the content any less interesting or useful; James does an excellent job of detailing his thought process throughout the article.

If you have any tips, project announcements, or generally interesting Django news, email me at clintecker+djangotips@gmail.com.

Django roundup: August 19

August 19, 2007

  • Django project news:
    • Adrian Holovaty proposed and ultimately implemented a new feature this past week that greatly enhances the process of developing your Django application. Summarized greatly, Adrian’s opening post put it like this: “wouldn’t it be useful we made it easy to run the Django development server with fixture data?” The new django-admin.py command, --testserver, is implemented as of revision [5912] and allows developers to load the development server with a test (temporary) database, populated with a set of fixture data. There's a bit more going on with this command that's detailed in the documentation.
    • On quite the roll this week, Adrian also spearheaded a re-factoring of the django.core.management code in [5898], converting the previously 1700+ line python script into a package that will eventually allow developers of 3rd party applications to add management functions without patching core Django code. Currently the existing code has been refactored and initial documentation can be found in the SVN repository at this time. There are still a few minor bugs to be ironed out, but all signs point to this change being a blessing for 3rd party developers.
    • The Google Summer of Code program is coming to a close today (Monday, August 20). This will mark the point at which students will be able to commit their code for inclusion in Django (if necessary) and allow external developers to work on their projects. In this session, Django had four student developers working on projects. Keep your eyes peeled over the next few days and weeks for the students’ final official updates. Certainly, and hopefully, many of these fine individuals will go on to maintain their projects and perhaps become regular contributors to the Django community. If you’ve foundtheir projects useful, please be sure to thank them for their hard work and contributions. I’ve taken this opportunity to list and summarize each of the projects below:
  • New Django sites of note:
    • Technically, I ran across this site last week but through some sort of technical blunder, it escaped my roundup. Noonhat is a Django-powered site that lets you meet people in your area for lunch. You make an account, associate an email address, pick a geographical location, and specify a radius in which you’d be willing to travel for lunch. If another user’s circle intersects yours, and your availability matches up, you can be paired for a lunch. The point behind Noonhat is to help nearby people meet each other and have conversations with individuals whom you might not normally ever meet under normal circumstances.
    • Marco Gabriel contacted me this week to let me know that he and Open Source Publishing Germany will be producing a German-language Django book, Django. Einführung in das Django Web Framework. Marco has also begun work on djangobuch.de which is a German language website to compliment the publication. Marco would also like to hear about any efforts to organize a German Django community (i.e. djangoproject.de) in the vein of Django Brasil, Django en español, Django-fr, and Django Japan.
  • Code snippets and projects:
    • A natural consequence of iPhone hacking is the installation of Django. Jacob Kaplan-Moss did just that. The iPhone uses CoreData for almost all of its storage needs and thus nearly all the information stored on the iPhone is inside SQLite databases. Pairing this information with a local install of Django and the inspectdb functionality allows anyone to create a web interface capable of viewing and editing anything on the iPhone. Jacob has yet to document his accomplishment in detail, so you’ll have to settle for Flickr. Django ‘It worked!’ screen on iPhone. Parsing the iPhone’s SQLite databases in Django.
    • Tim Baxter has posted a method on his blog for generating microformats—specifically vCard—using Django: “If you use Django, it seems inevitable that the database will quickly have a lot of data that just lends itself to microformats, particularly calendar events and contact information. So, I’ve been playing around with microformats quite a bit lately and spitting out hcalendar and hcard microformats all over the place
    • One of the holy grails of content management is a dead-simple method for capturing and displaying a list of every change made to your data. This can now be implemented almost perfectly (there are a number of missing features, most notably relationships) in your existing Django application with only a single line of code in your Django model. Check out the AuditTrail page in the wiki for more explanation, code, caveats, and documentation.
    • Bruce Kroeze has posted a lighttpd configuration on his blog that allows developers to serve their Django application through both standard HTTP and SSL-enabled HTTPS without any troubles. This is an especially important thing to get right when deploying a shopping cart application like the Satchmo Project.
    • The 10percentofeverything.com blog illustrates how you can easily interact with your Django application from command line scripts: “Sometimes, I need to write command-line scripts to populate a database with information from some other source, like a webpage or third-party database. Since Django uses MySQL (among others) for its backend storage, it’s fairly easy to use Perl or any other language for this task. Problem is, it’s very boring and fiddly, so now I tend to use Django instead, which is really easy.
    • Linux Journal, a monthly magazine, has published an article on getting started with Django: “It would be misleading to say that Django is a Python port of Rails (or vice versa)... Both aspire to make Web development fun and easy, removing as much of the drudgery as possible from such work. Both use the model-view-controller (MVC) paradigm for handling actions and creating pages. Both use a particular programming language throughout the system for code and configuration files. And, both have managed to rally a large following, ensuring that they both will continue to be developed for some time to come.

If you have any tips, project announcements, or generally interesting Django news, email me at clintecker+djangotips@gmail.com.

Django roundup: August 12

August 12, 2007

  • Django news:
    • Browsing through the repository checkins for trunk, I noticed that Malcom and Adrian had checked in over 50 patches for mostly bug-fixes to both code and documentation. If you’ve been waiting for a specific fix, take a look through the list. Thanks to everyone involved in working to get those 50+ patches integrated into trunk!
  • New Django sites of note:
    • Fredrik Lundh, maintainer of effbot.org, is currently porting over the "zone" (where things like PIL, Tkinter, and more are documented) to Django: “All in all, the zones at effbot.org currently contain around 2,000 documents, plus a couple of hundred user comments. Until now, the zone has been served as static HTML, generated and maintained using an increasinly disorganized collection of CGI scripts and off-site tools. Given that we moved pythonware.com to Django late last year, it’s about time I did the same to effbot.org.” Fredrik has written up his experiences during this process in a document which I highly recommend.
  • Code snippets and projects:
    • Maximillian Dornseif has posted a method for determining code-coverage of your Django project’s tests without having to alter any of the Django internals: “Siddharta Govindaraj has a blogpost on integrating Django with coverage.py to check what your tests actually test. Siddharta patches Django to archive his goals. But you can get the same results without fiddeling with Django’s Source-Code. Django now comes with a TEST_RUNNER setting which let’s you switch your testing engine.
    • Massimo Scamarcia sent me an email about his blog post that explains how you can create a basic Django-powered photo gallery in only a few minutes.
    • Michael Trier points us to a few different techniques for peeking inside Django’s ORM to see what database queries your application is generating.
    • Ross Poulton has written a blog post detailing how to configure and use subdomains with your Django project: “As a part of my previously mentioned upcoming bridal gift registry project (which, by the way, performed outstandingly in it’s most important private beta ever – my own wedding) I’m giving each user (in this sense, a user is a couple close to getting married) their own subdomain off of the main website – instead of having a URL to their registry like http://yourdomain.com/registries/view/?id=1048 there are beautiful URL’s like http://couplesnames.yourdomain.com.
    • Do you ever find yourself writing the same lines of code at the top of your views? Nathan Ostgard did and he’s such a dedicated DRY’er that he wrote a specialized middleware to clean up his code: “Having the same few lines at the top of every function in makes me feel dirty. You can clean this up with a Middleware class, replacing foo_id with the actual object before calling the view.” If you find yourself in the same situation as Nathan, head over to his blog, read his post, and hopefully make use of his middleware!

If you have any tips, project announcements, or generally interesting Django news, email me at clintecker+djangotips@gmail.com.

Django weekly roundup: August 6

August 6, 2007

Starting with this week I've begun formatting this report a bit differently. The order of these sections are quite arbitrary and may change from week-to-week as I find out which work out on a consistent basis. Feel free to comment on the new format in the comments below.

  • Helpful articles and links:
    • Michael Trier has written a lengthy article on his blog detailing some of the common issues people run into with Django’s syndication framework. He then describes a process you can follow to successfully get your feeds up and running.
    • Digging through items in del.icio.us tagged with ‘django’, I ran across this nifty Google search that returns a listing of all Google Code projects with ‘django’ in the title. Of course, I found a lot of known projects, but it was interesting to see all the others that don’t get publicized as often.
  • Code snippets and projects:
    • Last week we let everyone know that James Tauber had begun his work on fully fleshing out Atom support in Django. Less than a week later and James has completed his work. Check out James’ implementation of RFC 4287 for Django at its Google Code repository.
    • A newcomer to the Django community known only as ‘mamcx’ has begun the work necessary to complete the MSSQL backend. This backend had been left in a state of disarray as its original maintainers lost interest and the core of Django evolved over the past few years. Mamcx has already put in considerable work, but is somewhat new to Python and Django, so any assistance would obviously be much appreciated! Check out [5062] for his patches and comments.
    • Here’s a method of defining a set of URLs in your Django project that will never get cached.
    • Derek Willis has implemented iCal feeds in his Django application and written a subsequent post detailing how you can do it too. Using the excellent vObject library in tandem with Django (and applying a few idiosyncratic tweaks to make IE/Outlook happy) is very simple and eliminates the need for the developer (i.e. you) to develop any iCal templates!
    • Bradley Whittington has a series of posts on his blog that detail his development of a Django middleware to log statistics about users to a database. Part one details the construction of a data model to hold this information and how to log this information within a middleware component. Part two goes over one process by which you can aggregate this data in meaningful ways.
  • New Django sites of note:
    • FrePPLe came to my attention through a user-submitted email. FrePPLe is a specialized application for production planning in the manufacturing industry. It was described to me thusly: “A first part of it is an extensible planning engine written in c++ (with bindings exposed in Python). The second part is the user interface and data persistence layer. For this I have become excited about django: Django’s flexible and efficient framework provides the ideal foundation. Also, the Django mindset and design principles match very well with the easy-to-extend, easy-to-customize and easy-to-use goals of my project.” Check out the screenshots of FrePPLe and see how they’ve put the Django admin interface to work in some interesting ways.
    • Splice is an web application that allows users to upload, edit, and mix their music, as well as connect musicians from all over the world. Not only is this a really cool idea for a web site, it has a great design, and it’s written in Django!

If you have any tips, project announcements, or generally interesting Django news, email me at clintecker+djangotips@gmail.com.