Saturday, August 06, 2005

New Zope3 Skin


Today I developed a skin for Zope3. As is evident from an earlier post, I had been exploring the Django web app dev platform, and after some intensive use and investigation, I returned to zope3. It was like a breath of fresh air. However, I sorely missed the slick interface of Django.

So, I decided to make my own :-)
AdytumAdmin z3 skin

All of my z3 projects will be using this skin (or a derivative) as the default admin skin. This will give clients something they can be happy with/proud of when they visit the ZMI to manage their site, and it will keep me and other developers happy, as we have to look at the ZMI for hours on end each day. If you've worked with z3 at all yet, you know how basic and ugly the default (non) skin is... and thus understand the need for people to start doing this kind of thing.

I would like to note and share my gratitude of the fact that this was based on the ZopeTop skin for Zope3 (I think written by Paul Everitt). Without that work and prior development, this would have been an arduous task. With the work, it was a facile process of tweaking colors and shuffling page/zpt parts around. Simply fantastic.

Once again, z3 shines as a rapid development platform. This was all done in less than a day :-)

Update: This blog post originally pointed to resources that are now no longer available. However, thanks to the Wayback Machine, I've been able to rescue the old instructions from an archived version of the web page.

Setup

There are no docs included with the tarball. You just need to do the following:
  • checkout the adytumadmin directory from svn
  • move the adytumadmin directory into you lib/python directory of your z3 instance
  • create a the file etc/package-includes/adytumadmin-configure.zcml in your z3 instance directory with the following contents:
    <include package="adytumadmin"></include>
  • restart your z3 instance
Access

Access the skin by using ++skin++AdytumAdmin in your URL, e.g.:

http://127.0.0.1:8080/++skin++AdytumAdmin/@@contents.html

If you like this skin enough to make it your default skin and don't want to add it to the URL manually, just add this line to your etc/overrides.zcml file:
<browser:defaultskin name="AdytumAdmin">
Note that it is the skin name and not the skin package that is used.

Screenshots


Friday, August 05, 2005

Django vs. Zope3, or "The Right Web App Dev Platform"

development :: python :: zope 3 :: django



First of all, let me start off by saying that this is not a flame nor a
crusade :-) The title of this post needs to be taken in context: this
is about making the right choices for you, the developer. We are not
machines, we are quirky people, each with our own uniquenesses. The
choice of platform needs to be as much about what technology best fits
the needs of the project as well as that which fits the personality,
the strengths, and the weaknesses of the developer.

I just spent an interesting two days with django. Let me just say,
right off the bat: I like it, it's fun, it's cool. I like their site,
their growing docs (I've contributed a little to the wiki), the homey
feel of the project. I got my first little app up and running in no
time. Piece of cake, just as advertised.

However, for my second project, I wanted to do something a little
strange. Oddly enough, just the kind of irregular thing a client would
ask for. Thus began the headaches. I spent about 30 hours with my head
up against the wall. I will say that my primary problem was not
understanding the not-so-documented subtleties of django. Additionally,
I'm really not that good at database modeling. Object relational
mappers are cool (much better than having to write SQL), but to me, the
logical next step is to give up the ghost and use an object-oriented
database. For situations that require hard-core databases, hire the
dba/db designer, and do what's needed.

It was tough going. I really wanted to do some strange things, and
django didn't seem to be so flexible in different areas. And I think
that's actually something that the django developers have openly
stated. They have written and are targeting their software for a narrow
problem domain, a domain that brings them a lot of business and for
which there is great need.

I want to emphasize that I'm not a python or software noob. I've been
writing code, in one language or another, since 1981. I've been in the
industry since 1994. I've worked with twisted for a couple years, more
so recently. I regularly delve into its internals. I have a love/hate
relationship with Zope: I love z3 and hate Zope2. I spend a fair amount
of time digging through z3 code and find it (almost entirely)
delightful. However, I don't have any of that experience with django.
The source code doesn't make architectural sense to me. I guess I like
and use frameworks, and django's actually really an application and not
a framework. This is reflected in the code, and I have difficulty with
that.

So, as I slugged through the issues of bending django to my will, I
found myself wishing for things: what would it take to add ZPT support
to django's templating? Could a wrapper/adaptor be written for the ORM
so that ZODB could be used? Could the code be refactored to use
interfaces, adaptors and components? Yup. I was unconsciously trying to
rewrite djando into z3. However, this is also flattering to django: I
was trying to hang on as long as I could. Why? Well, it's got some
really cool things:

* a fantastic look and feel
* a slick admin interface generation (z3 has auto-generation of this
too, but it's not as pretty)
* really cool URL dispatcher for custom URLs perl application

Overall, they did some great work. They sell the point that you can
build apps in record time with django. And they're right -- you can.
But you know what else? I was able to build a project from the ground
up with z3 in two days -- and that *included* learning curve. No
kidding. Talk about rapid. I was stunned. In fact, after that
experience, I emailed several close developer friends of mine as well
as a few partner companies we consult for. I did a write-up on the
project and an analysis of the z3 development process and how it
benefits our timelines. The reason things went so smoothly with z3 is
because it's designed the way I think. By using a framework that
matches me so well, I move through code with zero resistance and get a
tremendous about of work done.

I'm not trying to sell z3 here. But, what I did discover with django
was that it's not my platform for web app dev: z3 is. This is because
of the kind of developer I am, the kind of code I like to work with,
and the kind of tools that allow me to be as productive as possible.
This combination of factors is different for different developers. As
many others in the community have pointed out, pick the right tools for
you and the job. There's a lot of hype about Rails, Django, etc., these
days; all the different web platforms available for python. People are
complaining about proliferation, but that's what drives evolution.
Software evolution has provided me with great business tools: twisted
and z3. What's it provided you?