我尝试制作一个简单的应用程序“留言簿”,将消息存储在作者的驱动器中。我使用库“httplib2”,“apiclient”“,”UriTemplate“。谷歌应用程序引擎不支持这些库,所以我已经包含在我的项目中。我开始使用webapp2并且工作得非常好。现在我尝试使用Django但是我不知道在哪里放我的库。我把它放在任何地方我得到一个“ImportError。”所以我的问题很简单,如何在django中包含我的库?
ImportError: cannot import name httplib2
Internal Server Error: /
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/handlers/base.py", line 101, in get_response
resolver_match = resolver.resolve(request.path_info)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py", line 340, in resolve
sub_match = pattern.resolve(new_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py", line 224, in resolve
return ResolverMatch(self.callback, args, kwargs, self.name)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py", line 231, in callback
self._callback = get_callable(self._callback_str)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/utils/functional.py", line 31, in wrapper
result = func(*args)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py", line 98, in get_callable
mod = import_module(mod_name)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/Users/mouaderraji/Desktop/gae-workspace/guestbook/guestbookdrive/views.py", line 5, in <module>
from guestbook import httplib2
ImportError: cannot import name httplib2
ERROR 2014-07-02 18:15:09,645 base.py:210] Internal Server Error: /
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/handlers/base.py", line 101, in get_response
resolver_match = resolver.resolve(request.path_info)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py", line 340, in resolve
sub_match = pattern.resolve(new_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py", line 224, in resolve
return ResolverMatch(self.callback, args, kwargs, self.name)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py", line 231, in callback
self._callback = get_callable(self._callback_str)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/utils/functional.py", line 31, in wrapper
result = func(*args)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/core/urlresolvers.py", line 98, in get_callable
mod = import_module(mod_name)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/django-1.5/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/Users/mouaderraji/Desktop/gae-workspace/guestbook/guestbookdrive/views.py", line 5, in <module>
from guestbook import httplib2
ImportError: cannot import name httplib2
INFO 2014-07-02 18:15:09,748 module.py:639] default: "GET / HTTP/1.1" 500 77550