<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: gcap</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/gcap.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2008-09-03T19:17:01+00:00</updated><author><name>Simon Willison</name></author><entry><title>Announcing dmigrations</title><link href="https://simonwillison.net/2008/Sep/3/dmigrations/#atom-tag" rel="alternate"/><published>2008-09-03T19:17:01+00:00</published><updated>2008-09-03T19:17:01+00:00</updated><id>https://simonwillison.net/2008/Sep/3/dmigrations/#atom-tag</id><summary type="html">
    &lt;p&gt;The team at &lt;a href="http://www.thisisglobal.com/"&gt;Global Radio&lt;/a&gt; (formerly &lt;a href="http://www.gcapmedia.com/"&gt;GCap Media&lt;/a&gt;) is the largest group of Django developers I've personally worked with, consisting of 14 developers split into two scrum teams, all contributing to the same overall codebase.&lt;/p&gt;

&lt;p&gt;Working with that many developers makes smart tools and processes essential, and in some cases we've had to develop our own. Today, we're releasing one of them as an open source project.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://code.google.com/p/dmigrations/"&gt;dmigrations&lt;/a&gt; is a Django migrations tool. It addresses a common problem in Django development: if you change a model after creating the database tables for it with &lt;code&gt;syncdb&lt;/code&gt;, how do you reflect those changes in your database tables without blowing away your existing data and starting again from scratch?&lt;/p&gt;

&lt;p&gt;&lt;a href="http://code.google.com/p/django-evolution/"&gt;django-evolution&lt;/a&gt; attempts to address this problem the clever way, by detecting changes to models that are not yet reflected in the database schema and figuring out what needs to be done to bring the two back in sync. In contrast, dmigrations takes the stupid approach: it requires you to explicitly state the changes in a sequence of migrations, which will be applied in turn to bring a database up to the most recent state that reflects the underlying models.&lt;/p&gt;

&lt;p&gt;This means extra work for developers who create migrations, but it also makes the whole process completely transparent - for our projects, we decided to go with the simplest system that could possibly work.&lt;/p&gt;

&lt;p&gt;The interface to dmigrations is a pair of custom Django commands. The first, &lt;code&gt;./manage.py dmigrate&lt;/code&gt;, provides a set of command for listing, applying and unapplying (reverting) migrations. This entirely replaces Django's &lt;code&gt;syncdb&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;The second, &lt;code&gt;./manage.py dmigration&lt;/code&gt;, provides commands for code-generating new migrations. It turns out that most migrations fit a set of common patterns: add a new table, add the tables for a new Django application, add a column to an existing table, add an index. These common cases are handled by dmigration; if you want to do something more complex (rename a column while transforming its data for example) you'll need to write a custom migration class.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://code.google.com/p/dmigrations/wiki/DmigrationsTutorial"&gt;dmigrations tutorial&lt;/a&gt; provides a full introduction to both of these commands, as well as hints on writing your own custom migrations. Since migrations are just classes, one of our hopes is that external developers will write extra migration classes for operations like "rename column" - things that currently require a one-off custom migration.&lt;/p&gt;

&lt;p&gt;dmigrations is actually the third iteration of our in-house migrations system. The first, smigrations, was designed to do the least amount of work possible to give us a controlled way of applying changes to our database schemas. The 's' stood for 'simple'. The second version (dmigrations) written by &lt;a href="http://t-a-w.blogspot.com/"&gt;Tomasz Wegrzanowski&lt;/a&gt; consisted of a major upgrade to smigrations that addressed many of the frustrations we found when using it with branched development, in particular the problem of migrations in two branches conflicting with each other. The 'd' stood for 'distributed'.&lt;/p&gt;

&lt;p&gt;Version three, released today, is my refactoring of dmigrations to de-couple it from the rest of our codebase. I've also stubbed out hooks for adding support for alternative database engines; dmigrations only supports MySQL out of the box, but I'm keen on getting it working with other databases now that it's out in the wild. Patches welcome!&lt;/p&gt;

&lt;p&gt;How does this fit in with &lt;a href="http://south.aeracode.org/"&gt;South&lt;/a&gt; and &lt;a href="http://code.google.com/p/django-evolution/"&gt;django-evolution&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;That's an excellent question. We'll be discussing all three systems on the schema evolution panel at &lt;a href="http://djangocon.org/"&gt;DjangoCon&lt;/a&gt; this weekend. I would love to see co-operation between the projects; at the very least I'd like to see the emergence of a standard Django-style abstraction library for create/alter table statements (something we punted on entirely with dmigrations). You'll certainly be hearing a lot more about migrations in Django after the conference.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/dmigrations"&gt;dmigrations&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gcap"&gt;gcap&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/globalradio"&gt;globalradio&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/open-source"&gt;open-source&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/projects"&gt;projects&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="django"/><category term="dmigrations"/><category term="gcap"/><category term="globalradio"/><category term="open-source"/><category term="projects"/><category term="python"/></entry><entry><title>Django: Security fix released</title><link href="https://simonwillison.net/2008/Sep/3/django/#atom-tag" rel="alternate"/><published>2008-09-03T00:14:00+00:00</published><updated>2008-09-03T00:14:00+00:00</updated><id>https://simonwillison.net/2008/Sep/3/django/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.djangoproject.com/weblog/2008/sep/02/security/"&gt;Django: Security fix released&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
The Django admin used to save partially-submitted forms if your session expired, and continue the submission when you logged in. It turns out that’s actually an unblockable CSRF exploit and is hence broken as designed, so it’s now been removed. Thanks Ed Eliot and other GCap colleagues for helping me flesh out the potential attack.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/csrf"&gt;csrf&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django-admin"&gt;django-admin&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ed-eliot"&gt;ed-eliot&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/exploit"&gt;exploit&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gcap"&gt;gcap&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/security"&gt;security&lt;/a&gt;&lt;/p&gt;



</summary><category term="csrf"/><category term="django"/><category term="django-admin"/><category term="ed-eliot"/><category term="exploit"/><category term="gcap"/><category term="security"/></entry><entry><title>Capital Radio (the new site)</title><link href="https://simonwillison.net/2008/Aug/28/capital/#atom-tag" rel="alternate"/><published>2008-08-28T14:47:27+00:00</published><updated>2008-08-28T14:47:27+00:00</updated><id>https://simonwillison.net/2008/Aug/28/capital/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.capitalradio.co.uk/"&gt;Capital Radio (the new site)&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Launched today, this is the Django-powered project I’ve been working on with the fantastic team at GCap.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/capitalradio"&gt;capitalradio&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gcap"&gt;gcap&lt;/a&gt;&lt;/p&gt;



</summary><category term="capitalradio"/><category term="django"/><category term="gcap"/></entry><entry><title>Back to full-time employment</title><link href="https://simonwillison.net/2008/Aug/22/employment/#atom-tag" rel="alternate"/><published>2008-08-22T17:26:39+00:00</published><updated>2008-08-22T17:26:39+00:00</updated><id>https://simonwillison.net/2008/Aug/22/employment/#atom-tag</id><summary type="html">
    &lt;p&gt;I've been freelance for a year and a half now, and it's been a great deal of fun. For me, being freelance meant having the freedom to pursue all sorts of different interests - technical writing, public speaking, Django, OpenID, JavaScript - and the opportunity to work with some really fantastic people.&lt;/p&gt;

&lt;p&gt;It was going to take a very special opportunity to pull me back in to full-time employment, but I believe I've found that opportunity at &lt;a href="http://www.guardian.co.uk/"&gt;the Guardian&lt;/a&gt;. I'll be joining them full time (well, four days a week) in mid-October as a software architect, collaborating with their development team on some ambitious API projects. The Guardian have access to a &lt;em&gt;lot&lt;/em&gt; of interesting data and I can't wait to get stuck in to it. Since they're a newspaper, it shouldn't be a surprise that they &lt;a href="http://www.guardian.co.uk/media/2008/aug/22/guardianmediagroup.digitalmedia"&gt;scooped me to the story&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'll be particularly sorry to say good-bye to the outstanding team I've been working with at &lt;a href="http://www.gcapmedia.com/"&gt;GCap&lt;/a&gt;. I'm looking forward to talking about some of the things we've been working together over the next few weeks.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/employment"&gt;employment&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gcap"&gt;gcap&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/guardian"&gt;guardian&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/jobs"&gt;jobs&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/personal-news"&gt;personal-news&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="employment"/><category term="gcap"/><category term="guardian"/><category term="jobs"/><category term="personal-news"/></entry><entry><title>South</title><link href="https://simonwillison.net/2008/Aug/8/aeracode/#atom-tag" rel="alternate"/><published>2008-08-08T11:42:00+00:00</published><updated>2008-08-08T11:42:00+00:00</updated><id>https://simonwillison.net/2008/Aug/8/aeracode/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://aeracode.org/projects/south/"&gt;South&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
A brand new light-weight Django migrations tool from Andrew Godwin. On first glance, this is spookily similar to the system we’ve been putting together at GCap.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/andrew-godwin"&gt;andrew-godwin&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gcap"&gt;gcap&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/migrations"&gt;migrations&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/south"&gt;south&lt;/a&gt;&lt;/p&gt;



</summary><category term="andrew-godwin"/><category term="django"/><category term="gcap"/><category term="migrations"/><category term="south"/></entry><entry><title>Capital FM London Traffic Map</title><link href="https://simonwillison.net/2008/Jun/27/traffic/#atom-tag" rel="alternate"/><published>2008-06-27T18:22:05+00:00</published><updated>2008-06-27T18:22:05+00:00</updated><id>https://simonwillison.net/2008/Jun/27/traffic/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://travel.capitalradio.co.uk/"&gt;Capital FM London Traffic Map&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
We launched this today at GCap (née Global Radio). I’m particularly impressed with how well the team handled clustering the traffic cameras on the Google map.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/capitalfm"&gt;capitalfm&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/clustering"&gt;clustering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gcap"&gt;gcap&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/google-maps"&gt;google-maps&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/london"&gt;london&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/traffic"&gt;traffic&lt;/a&gt;&lt;/p&gt;



</summary><category term="capitalfm"/><category term="clustering"/><category term="gcap"/><category term="google-maps"/><category term="london"/><category term="traffic"/></entry><entry><title>Django Users Group London meetup, 19th of May</title><link href="https://simonwillison.net/2008/May/2/djugl/#atom-tag" rel="alternate"/><published>2008-05-02T12:19:45+00:00</published><updated>2008-05-02T12:19:45+00:00</updated><id>https://simonwillison.net/2008/May/2/djugl/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://upcoming.yahoo.com/event/546918/"&gt;Django Users Group London meetup, 19th of May&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
The inaugural meeting of DJUGL will be on the 19th of May at the Capital Radio building in Leicester Square, sponsored by GCap Media. Three presentations starting at 7pm (I’ll be giving one of them), then on to the pub. Sign up on EventWax; there are only 70 places.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/djugl"&gt;djugl&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/events"&gt;events&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gcap"&gt;gcap&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/gcapmedia"&gt;gcapmedia&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/london"&gt;london&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;



</summary><category term="django"/><category term="djugl"/><category term="events"/><category term="gcap"/><category term="gcapmedia"/><category term="london"/><category term="python"/></entry></feed>