Using couchdbkit (a third-party library) in the Google App Engine

I find it hard to get couchdbkit to function properly in the Google App Engine. I either do not import my libraries correctly, or I run the GAE Python Sandbox rules . Does anyone know if restkit needs to be enabled when using couchdbkit in GAE (which is where some problems arise)?

Here is my configuration:

app.yaml
zapdome.py
couchdbkit /
restkit /

I split zapdome.py only into the basics (connect to my CouchDB database server):

#! /usr/bin/env python

import urllib, httplib, datetime
from couchdbkit.schema.base import *
from couchdbkit.schema.properties import *
from couchdbkit.client import Server

USERNAME = ''
PASSWORD = ''

class QuoteEntry(Document):
    name = StringProperty()
    symbol = StringProperty()
    price = StringProperty()
server = Server('https://' + USERNAME + ':' + PASSWORD + '@' + USERNAME + '.cloudant.com/')

These are the errors that I log:

E 2011-05-05 20:39:31.309
Traceback (most recent call last):
E 2011-05-05 20:39:31.309
  File "/base/data/home/apps/zapdome/1.350215157753999092/restkit/__init__.py", line 12, in <module>
E 2011-05-05 20:39:31.309
    from .client import Client, MAX_FOLLOW_REDIRECTS
E 2011-05-05 20:39:31.309
  File "/base/data/home/apps/zapdome/1.350215157753999092/restkit/client.py", line 21, in <module>
E 2011-05-05 20:39:31.309
    from httplib import FakeSocket
E 2011-05-05 20:39:31.309
ImportError: cannot import name FakeSocket
E 2011-05-05 20:39:31.309
Traceback (most recent call last):
E 2011-05-05 20:39:31.309
  File "/base/data/home/apps/zapdome/1.350215157753999092/couchdbkit/__init__.py", line 10, in <module>
E 2011-05-05 20:39:31.310
    from .resource import  RequestFailed, CouchdbResource
E 2011-05-05 20:39:31.310
  File "/base/data/home/apps/zapdome/1.350215157753999092/couchdbkit/resource.py", line 25, in <module>
E 2011-05-05 20:39:31.310
    from restkit import Resource, ClientResponse
E 2011-05-05 20:39:31.310
ImportError: cannot import name Resource
E 2011-05-05 20:39:31.310
<type 'exceptions.SyntaxError'>: 'import *' not allowed with 'from .' (__init__.py, line 159)
Traceback (most recent call last):
  File "/base/data/home/apps/zapdome/1.350215157753999092/zapdome.py", line 4, in <module>
    from couchdbkit.schema.base import * 

Since it is choking on httplib.FakeSocket and restkit.Resource, I'm starting to think that I'm going beyond what GAE allows. Anyone have any thoughts? Thank.

+3
2

, , , - GAE Python Sandbox. , . Cloudant Quora, Python/Django.

, WebFaction , sys ( ).

+1

, . , * , .resource. * Python 2.5.

*, , , . .

0

All Articles