views:

87

answers:

2

This may be a basic question but how can I include a module with my app.

I'm very new to python and what I want to do is to include this module simplejson with my app, but after downloading it I have no idea what to do next :(

This is how the module looks like after unzip it.

I don't know what files to move to my app.

This is the unzipped module

+1  A: 

Put the directory (or a link) into your deployment directory and appcfg.py update will send it along to the server. This is documented in the Python Runtime Environment page.

msw
erh.... what file? the whole .tar.gz????? nahh.. the simplejson directory? :( seems very easy and yet I don't have a clue :(
OscarRyz
Yes, the unpacked simplejson directory itself. Experiment on it with dev_appserver first because it is easier.
msw
@msw Thanks you. I figure out a minute later :P and after reading the link you posted I saw I can also use symbolic link :)
OscarRyz
+3  A: 

Put the simplejson directory (that is inside the simplejson-2.1.0) in your app.

Or, you could just use the simplejson lib that's bundled with the Django lib that's bundled with App Engine by doing the following import wherever you need it:

from django.utils import simplejson

That's always available, without needing to bundle anything extra with your app. The only drawback I can think of is that it will be out of date (though I don't know how far out of date).

Will McCutchen
Thanks a lot. I did both and for now ( since I'm learning ) I'll use the one that comes with django. Eventually I might need the other and is good to know how to use it.
OscarRyz
I'm glad I could help. I too would just use the one that's already available until I ran into some limitation that could be overcome by bundling your own, newer, version of `simplejson`.
Will McCutchen