My favorites | Sign in
Project Logo
                
Search
for
Updated Sep 18, 2009 by mi...@redinnovation.com
Labels: Featured
DevGettingStarted  
Hopefully simple steps to get you ready to be a productive GetPaid developer

Getting Started

Setting up a development environment is now easy thanks to our use of zc.buildout ( http://python.org/pypi/zc.buildout )

zc.buildout is a framework for creating repeatable installs, and is in widespread use in the Zope3 and Plone 3 communities. It installs Zope, Plone, all the getpaid products, the requisite python libraries, and setups an instance that's usable out of the box for development.

Ingredients

You'll need:

  • 1 Gmail account and a GoogleCode subversion password (you can get the latter at http://code.google.com/hosting/settings)
  • 1 subversion commandline client, svn
  • 1 zope-acceptable python interpreter, header files, and libraries.
  • 1 working C toolchain (everything you could have used to compile the above interpreter), such as 'gcc'
  • Libraries: profiler, simplejson and elementtree. For testing authorized.net with buildout, you'll also need libssl-dev and swig does not work with the latest version of SWIG (1.3.31)
  • 2 tbsp. fair trade, organic, shade-grown tea, coffee or yerba mate.
  • 254MiB of diskspace

To Get Started

New fashioned way

This checkout method is possible for Plone 3.2.x and later which are purely Python egg based Plone distributions.

  1. Make a normal Plone 3.x install using paster plone3_buildout command
  2. Modify the resulting buildout.cfg as described in getpaid.trunk.cfg instructions
  3. Run commands described in getpaid.trunk.cfg

Old fashioned way

Checkout the getpaid.buildout infrastructure. The code for both Plone 2.5 and 3.0 buildouts can be obtained together, so only one place to check out from. Make sure you check it out to a location outside of any existing Zope instances.

svn co https://getpaid.googlecode.com/svn/getpaid.buildout/trunk getpaid.buildout

Make sure you use https and not http, as you will have authentication problems later if you do.

Note: The anonymous buildout is no more supported.

For using authorize.net payment processor, uncomment zc.authorizeddotnetet and getpaid.authorizenet in buildout.cfg

Run the buildout bootstrap script using a python interpreter that Zope likes (for example, python2.4):

cd getpaid.buildout
python2.4 bootstrap.py

This creates a few directories used by buildout. Then you run a command depending on which version of Plone you want:

For Plone 2.5 run:

bin/buildout -v

For Plone 3.0 run:

bin/buildout -c 30.cfg -v

For Plone 3.1.6 run:

bin/buildout -c 316.cfg -v

The -v isn't necessary, but may make you feel better in the knowledge that a lot is going on.

Note: Do NOT attempt to run a buildout of one instance in a buildout directory that you had a different version in already. Start with a clean buildout directory and choose either the 2.5, 3.0, or 3.1 buildout config for that buildout (do not run a 3.0 buildout in the directory that you had a 2.5 buildout.)

You can copy the cfg and alter the Plone version it's pinned to, if you'd prefer to attempt a different, possibly more recent Plone version.

Brew your caffeinated beverage of choice: this will take a long time and use up to 200Mb of disk space. It will:

If you've done this once, see "Updating the buildout" below.

To start Zope 2, you can now do:

bin/instance fg

By default, the ZMI adminisration username/password is admin/admin. If the ZMI hangs, check your console: PDBDebugMode is installed by default, so you get a debugger prompt whenever there would have been a traceback.

Installing the product

Create a Plone site within your zope instance. Go to site setup. Install the GetPaid product. It is not necessary to install the other products listed.

Debugging and testing

If you wish to have an interactive python prompt that has all the packages Zope is aware of, e.g. for testing purposes, you can run:

bin/zopepy

Updating the buildout

Just do a

svn up

from your getpaid.buildout folder to update the buildout.

Then run the buildout again. Be sure to run the command corresponding to the same version of Plone you built originally, otherwise this will break your build.

For Plone 2.5

./bin/buildout -N

For Plone 3.0

./bin/buildout -c 30.cfg

For Plone 3.1.6

./bin/buildout -c 316.cfg

That's it!

Troubleshooting

hurry.workflow errors

You need to re-run the build-out to get the latest .cfg file. Try:

~/getpaid.buildout/bin/buildout -v -N

M2Crypto errors and Authorize.net

Authorize.net requires some new crypto libraries. We removed this from buildout.cfg so that dependencies aren't needed at this point for a general audience.

future Steps to install:

On OSX: It looks like we need to install SWIG via DarwinPorts: sudo apt-get install swig

M2Crytpo had some additional dependencies that still need to be worked out for the buildout...

GoogleCode profile page doesn't show the SVN password

It seems that it only works for Google accounts that have subscribed to Gmail.

Errors during checkout

The initial checkout takes a long time, connects to a multitude of servers, and in general has several interesting ways it can fail. If it does, just enter the getpaid-buildout directory and do an svn up:

cd getpaid-buildout
svn up

the svn fu will continue where it left off.

No such file or directory while doing execfile

We really meant it about using the commandline svn client; if you use a GUI client, make sure it correctly supports svn:externals. For example, rapidsvn prior to 0.9.4 does not. Do a svn up; make certain all externals are pulled in.

The instance hangs!

Installation of the PloneGetPaid product may appear to hang. There's an installed product called PDBDebugMode that brings up a Python Debugger prompt whenever there's an error (which is why it looks like it's freezing). When you're running in debug mode, you'll see a prompt appear in your terminal window. Just hit 'r' (sometimes several times) to continue. If in doubt, stop your Zope instance and restart it.

AccessControl/cAccessControl

internal error occured due to a bug in either zc.buildout or in a recipe being used:
AccessControl/cAccessControl.c:2312: error: ‘PROBLEM’ undeclared (first use in this function)

Seems to be caused by using the wrong version of Python. You can correct this by providing the full path to Python2.4 when running bootstrap.py

/path/to/python24/python bootstrap.py

You may need to install PIL to make it run:

http://www.pythonware.com/products/pil/

AttributeError: ore.member

If you got that error trying to install PloneGetPaid on your plone site, please restart the zope instance and try again. Now ore.member should exist and you should have no problems for finishing the PloneGetPaid installation.


Comment by peter2win, Apr 16, 2008

"Libraries: profiler, simplejson and elementtree. For testing authorized.net with buildout, you'll also need libssl-dev and swig does not work with the latest version of SWIG (1.3.31)"

How to get and install all of these?

Comment by geoffDeGeoffGeoff, May 29, 2008

I am having a lot of trouble installing GetPaid?. First I tried a new zope instance and the tarball. This gave me an attribute error when trying to create new sites. Now I try the buildout and...

An internal error occured due to a bug in either zc.buildout or in a recipe being used:

URLError: <urlopen error unknown url type: https>

Usually products take 10 mins to install. I have spent a day now :-( will all zope3 style products be this difficult to set up?

Comment by eric.c.jahn, Jun 10, 2008

geoff, here is an upgrade doc I just wrote, but it should tell you what you need for a new install of getpaid as well. http://ejahn.net/Members/eric/stories/getpaid-.6-update

Comment by geoffDeGeoffGeoff, Jul 12, 2008

If you get "urlopen error unknown url type: https" using buildout make sure you have openssl and libssl-dev installed before you install python (on ubuntu sudo apt-get install openssl libssl-dev)

Comment by fxmarin, Oct 24, 2008

In a clean installation, during first bin/buildout -c 316.cfg -v

I've encountered this error:

Installing 'zc.recipe.testrunner'.

We have the best distribution that satisfies 'zc.recipe.testrunner'.

Picked: zc.recipe.testrunner = 1.1.0

While:

Installing.
Getting section test.
Initializing section test.
Installing recipe zc.recipe.testrunner.

Error: There is a version conflict.

We already have: zope.testing 3.5.0

but zc.recipe.testrunner 1.1.0 requires 'zope.testing>=3.6.0'.

Do you have any solution ?

Comment by nhajratw, Oct 27, 2008

I have a Plone 3.1.6 buildout installation. I am having trouble finding clear instructions on adding GetPaid? to it. It seems like it should be straightforward... any pointers?

Comment by lucielejard, Nov 10, 2008
Comment by eric.c.jahn, Nov 13, 2008

nhajratw, For production environments, I use getpaid 0.6.2 with Plone 3.1.6. lucielejard's comment would be suited for a development environment. To go the production route, I'm working on a how-to located here: http://ejahn.net/Members/eric/stories/getpaid-.6.2-with-plone-3.1.6 Essentially, after you have your 3.1.6 buildout installation, you add getpaid's dependencies into buildout, then rerun buildout. Then get the 0.6.2 getpaid tarball and extract its contents into appropriate places into the plone installation, then activate getpaid in as an add-on in Plone's setup screen. It works great, but I only have Google Checkout working seamlessly. Waiting for Paypal.

Comment by hannesc, Jan 19, 2009

When trying bootstrap.py I get the following error:

Downloading http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c9-py2.4.egg Traceback (most recent call last):

File "bootstrap.py", line 43, in ?
PYTHONPATH=
AttributeError?: 'NoneType?' object has no attribute 'location'

Comment by rochellebatts03, Jun 30, 2009
well i will not have any trouble installing i assume.
Comment by kingsleysimeon, Aug 18, 2009

with the aim of this firm establishment, I hereby commend all the cooperatives and board of directors to keep it on the there drive to success. am Kingsley Simeon Duru with great aim and focus towards success will gladly join this association. thanks.


Sign in to add a comment
Hosted by Google Code