Developer config bundleΒΆ

Tags: instancemanager, plone

You're using all sorts of new-fangled stuff that makes your plone website a lot faster. ResourceRegistries (portal_css and portal_javascripts) combine your stylesheets and spreadsheets into one file, which is handy for caching. You've set up cachefu and squid just right, making your customer very happy.

Now you continue working on the site and want to make some css improvements. Suddenly you have to bang up your keyboard, sacrifice your kitten and do a little rain dance just to get your css files to refresh. Darn resource registry! Darn cachefu! Darn squid that's not in front of my local development instance on my laptop!

Of course, you can uninstall cachefu and put resource registries into debug mode. But I'm testing locally with the customer database, which has all those for-production settings. And the generic setup profile also, of course, sets the production settings.

Solution

The solution: have a product set all those developer settings for you and install it only on your development machine. Fine. Time to get cracking. I created a bundle to do the following:

Resource registries
portal_css and portal_javascripts are put into debug mode. Now you get the real css and javascript files (uncached) instead of plone4321.css and so.
Cachefu
Cachefu is uninstalled, that's the handiest (though brute-force) way of not sending out caching headers that can cause caching side effects.
Products that are installed

Some products are installed that you normally don't want on your production site:

  • PloneErrorReporting provides more details about the error - right in your browser where they occur. It is bundled with plone, but not enabled by default.
  • Clouseau gives you a very nice in-browser javascript-based python prompt.
  • DocFinderTab - There is no svn source for it that I can find. Till lurker puts it in the collective (which he said he'd look into), I've just slapped the extracted tarball in here.
  • enablesettrace adds the possibility to put an import pdb;pdb.set_trace() into your python scripts.

Where to get it

You can do an svn checkout of the bundle at https://svn.plone.org/svn/collective/developerconfig/bundles/plone25develop.

Instancemanager

Maurits added a setting to instancemanager (for instancemanager, also see my posts). Set development_machine = True in your userdefaults.py on your development machine. Next, add the developer config bundle to your project's bundles, but mark it as for-development-only:

symlinkbundle_sources = [
    'preu/externalproducts',
    'preu/products',
    {'source': 'preu/plone25develop',
     'develop': True},
    ]

It is that last dictionary that does the trick. Items with develop=True will only get installed on development machines.

Instancemanager is not really needed, but it can make life much easier in this case.

 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):