Moving from Django to Plone


This is the first of what might be a series of posts about learning Plone.

I’ve worked in Django since January 2006, when Joe HeckKaren Williams, and I built the now-defunct TrenchMice site. I haven’t done any Django work since March, when I joined Fisher Communications, but I’ve followed the mailing lists and blogs. And I bought and read the recently published Django books, just for grins.

At work, I’ve been getting ready to launch a Django-based CMS project. It was going to use Ella, PyLucid, Ellington, or maybe be built from scratch. But at the end of July, unexpected requirements changes made me shift it from Django to a Plone base. (I won’t go into the reasons why now; that’s an interesting post for a later time.) So without any warning, this Djangonaut needed to become a Plonista.

I thought that writing about my process of learning Plone might be useful to future Plone neophytes. Or at least entertaining.

Caveats

I’ve been learning Plone for all of one month — and a significant part of that month was actually spent working on other small projects. Many of my impressions and thoughts may be naive or flat-out wrong. If you argued that trying to learn anything from my posts would be like the blind leading the blind, you’d have a strong case.

I’m learning from books and on-line documentation, and my best other framework is Django. If you have a colleague’s assistance, or you’re coming from another web framework, your experiences may be different.

Why write about Django -> Plone?

Plone is a CMS, and Django is a web framework. Isn’t it silly to write about going from one to the other?

As far as I know, all Django-based CMS today are libraries of Django applications and templates. I.e., when you’re developing in a Django-based CMS, you’re actually developing in Django itself.

Plone is layered on top of Zope CMF, which is a CMS framework product for Zope. Zope is a web application framework. So Zope, Zope CMF, and Django would be at roughly equivalent levels in a software stack. For the record, then, any comparison should be between Django and Zope.

It so happens that a lot of Plone work is in fact done in Zope. You’re either using the Zope Management Interface (ZMI), or fiddling with your development box’s Zope server, or editing Zope files. Some work is done in Plone’s site configuration tools, or in Plone product files. But if you’re doing any non-trivial Plone work, you’ll be working in Zope.

Since Plone is a CMS and Django per se is not, we shouldn’t be surprised that Plone is more powerful. This isn’t a criticism of Django; they’re different tools aimed at different jobs. But they have similar concepts: Schemas, configuration files, templates, Python code behind templates, forms, content types, etc. In any case, I’m not writing to compare Plone and Django; I’m writing about how it is to learn one after working in the other.

First impressions

The first thing that bowled me over was how much more stuff Plone has. My head was swimming for two weeks with new acronyms, concepts, and code pool organizations.

Let’s start with this: Plone comes with a built-in object-oriented database, Zope Object DataBase (ZODB), and an optional distributed object architecture layer called Zope Enterprise Objects (ZEO). (But ZODB isn’t tied to Zope; any Python application can use it.) ZODB’s lowest layer writes to FileStorage by default, which stores pickles in a single file, with the right things magically done for transactions and updates.

Adapters allow you to replace FileStorage with other stores, like PostgreSQL, but most CMS applications would want to use ZODB. It’s designed to store Python objects, and is tuned for lots of reads and occasional writes. That’s exactly what a CMS would want. If I were building a CMS with Django, I’d be using an SQL database, which wouldn’t be optimal. (The Django mailing lists have occasional posts about using an OODB with Django. It’s not the framework’s design center, and I don’t know if any of them are viable. I personally tended to avoid anything not documented in the Django site.)

When you install Django, you also install, say, PostgreSQL and psycopg. You don’t think of the latter two as being part of Django, and so their complexity is not Django’s. But you’ve got to install them, administer PostgreSQL, and maybe do some tuning. Plone out of the box effectively includes the equivalent of Django + PostgreSQL + psycopg. (Yes, Django comes with a built-in development server, but it’s not for production use.) (Yeah, an OODB is not an RDB, but they’re both database servers.)

Plone comes with so much stuff that it’s actually a working CMS out of the box, including content types and permission-based workflows:

Plone out of the box

Plone out of the box

…while Django just provides a “Welcome to Django” page. That’s OK, Django is not a CMS!

Plone and Zope have been around for longer than Django, and so they have more legacy cruft. There’s Zope 2 and Zope 3 (one is not a newer version of the other — they’re incompatible — great naming choice, guys), Plone 2 and Plone 3 (Plone 3 runs on Zope 2 – clear?), an older and newer way of packaging (and therefore, installing) products, and a compatibility package that provides Zope 2 access to some (most?) Zope 3 objects. I don’t know the exact origination dates, but Zope has existed since at least 1996, and Plone 1 was released in 2003, which was also the year of the first Plone conference.

Django’s got a much cleaner code universe. But it, too, will have legacy cruft when it’s 12 years old. In a way, this is a good problem to have, because it indicates technology with a long and vibrant run. But, it increases the concepts you’ve got to learn, or, the number of mental notes needed to ignore documentation about the alternative techniques.

Books, presentations

Don’t waste your money on The Definitive Guide to Plone or Building Websites with Plone. The former is available free on-line, and both were written in 2004. That’s a millennia in Plone time. Unless you’re maintaining a system that hasn’t been updated in four years, they’re useless.

The Plone book to buy is Professional Plone Development. And the Zope book to download is The Zope Book.

At the Seattle Plone Gathering‘s April meeting, Justin James and Brian Gershon gave a talk comparing Plone and Django. Check out their slides.

On-line documentation

This is an area where Django really, really shines. You can learn DJango by starting at the top of Django’s documentation page and working your way down the page. That, and following the Django users mailing list, will get you productive in a very short amount of time. The newly released Django books are great, but you can do great things without them.

In contrast, I find Plone and Zope 2‘s documentation very confusing. With Django, it’s clear where to start reading, and the concepts are introduced in a logical order with very few forward references. With Plone, I can’t tell where to start. The documentation isn’t (IMHO) organized with an obvious “top.” Everything references everything else, and you have to master multiple concepts before you can be productive. For those of you who, like me, sometimes worry about being smart enough to master something, it sets the stage for a lot of stress. (What does xyz mean again? Dang it, I read about it yesterday. What tutorial was that in? Ahhhh, shoot, I thought I bookmarked it. OK, here it is. (refresh memory) Now, where was I? Ahhh, nuts…)

Make contacts and Plonista friends

I can’t emphasize this strongly enough: Join your nearest Plone group and make some new friends. It’ll help you get up to speed. (And after you get up to speed, remember to pass on the good karma by helping others!)

The Seattle Plone Gathering seemed like a moribund site. But, no: They’re alive and well, and have regular meetings. Some of the members have been gracious in welcoming me to the club, and super helpful in giving me pointers. (Thank you, Brian, Jesse, and Andrew!)

7 comments
  1. John said:

    Great post, I have been interested in how the python based frameworks such as Django and Turbogears compare to plone as I recently spent a lot of time working in plone with the recent migration of our site from a php based CMS to plone 3. Looking forward to hearing more.

  2. Hi John,

    Yeah very insightful post. I’ve been dev-ing in Plone for about 5 years now and therefore sometimes forget the challenges of picking up the framework/application so it was great to have a ‘litmus test’ of how we’re going in terms of documentation/etc. And BTW as a longer-term Plonista I’d definitely say the *community* is our greatest asset!

    -Tim

  3. Martin said:

    Well, this is interesting – I am doing the exact opposite. After working with plone on and off the last couple of years I decided to learn Django.

    My reasons were that Plone is sometimes too much. Plone is great when all the bells and whistles are needed, but when a simple web page with clean widgets that interacts with a SQL database is all that is required – plone is perhaps overkill and not even good at it.

    I love plone – but the author is right. There is plenty of documentation but knowing what to read and where to start is not clear. And the concepts like TAL, TALES, METAL, Zope Page Templates, Archetypes, Acquisition, etc, etc, etc can be overwhelming. Plone out of the box is fantastic. BUT as soon as any customizing is required learning the above concepts become mandatory.

    Yesterday was my first day learning about Django. I did the tutorial. (Tutorial is a concept not used enough in the Plone world). WOW – the tutorial was FANTASTIC!!!!!! The code works and the concepts are well explained! So – I’m keen on seeing if I can make Django work for my simple projects and use Plone for when I need all the Bells and Whistles.

  4. John said:

    @Martin: Thank you for commenting. That is interesting. The Django documentation is great, eh? You learn so much, and all in the right order, just by starting at the top of Django’s documentation page and working your way down the page, link by link. It’s very well done. (And it was even well done before it was recently reorganized and improved!)

    Are you able to compare Zope 3 (of which I have no experience – I’ve been focussing on Zope 2) with Django?

    I hope you write in again after you’ve learned more Django, and share with us how you’re doing. Or, feel free to post a link here to your own blog.

    Good luck!

  5. Saka said:

    Plone :)
    I know Plone And Django.
    I want to ask if somebody meet Plone WEB2 web site around the web?
    With big traffic and a lot of logged in users?
    NO WAY!!!
    Plone GOOD as a static CONTENT PLATFORM. NO MORE!!!
    I like plone – I also like windows VISTA.
    but I prefer UBUNTU!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 9,525 other followers

%d bloggers like this: