How to include python-dateutil in Google App Engine?
Question: How can I use the `python-dateutil` library in Google App Engine? I am using
the `webapp2` framework and need to know how to include the library and use it
in my script.


Answer: EDIT2: Here's the recommended way to do this now:
<https://cloud.google.com/appengine/docs/python/tools/libraries27#vendoring>

~~EDIT: Thanks to @TimHoffman, the correct (App Engine) way to do this is
documented[here](https://developers.google.com/appengine/docs/python/tools/appengineconfig#Configuring_Your_Own_Modules).
Ignore what I said below.

I've actually had to do this exact thing. First, I created a folder in my app
project called 'lib' to hold any python libraries that aren't included with
App Engine (for project organization). Then, I downloaded the dateutil python
source and placed it in the new 'lib' folder. Finally, in your actual app
code, before importing the desired libraries, you must add this line:

    
    
    sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
    

which just places the 'lib' folder in the python path so that python knows
where the module actually is. Then simply:

    
    
    import dateutil
    

Alternatively, you could just put the module code directly in your app folder,
and python will automatically look in your program's folder for the module.
Also, make sure it's included somewhere in your app.yaml so that it actually
gets uploaded to google's servers.

The key, though, is that you must include the code for the module somewhere
with your app.~~

