Django and Google App Engine Assistant did not find ipaddr module

I am trying to run Django on GAE using this tutorial .

When I run python manage.py runningerver, I get stacktrace below. I am new to django and python, so I don't know what my next steps are (this is Ubuntu Jaunty btw). Django does not seem to find the GAE ipaddr module that comes with SDK 1.3.1.

How to get django to search for this module?

/home/username/bin/google_appengine/google/appengine/api/datastore_file_stub.py:40: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5

/home/username/bin/google_appengine/google/appengine/api/memcache/__init__.py:31: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha
Traceback (most recent call last):
  File "manage.py", line 18, in <module>
    InstallAppengineHelperForDjango()
  File "/home/username/Development/GAE/myapp/appengine_django/__init__.py", line 543, in InstallAppengineHelperForDjango
    InstallDjangoModuleReplacements()
  File "/home/username/Development/GAE/myapp/appengine_django/__init__.py", line 260, in InstallDjangoModuleReplacements
    import django.db
  File "/home/username/Development/GAE/myapp/django/db/__init__.py", line 57, in <module>
    'TIME_ZONE': settings.TIME_ZONE,
  File "/home/username/Development/GAE/myapp/appengine_django/db/base.py", line 117, in __init__
    self._setup_stubs()
  File "/home/username/Development/GAE/myapp/appengine_django/db/base.py", line 128, in _setup_stubs
    from google.appengine.tools import dev_appserver_main
  File "/home/username/bin/google_appengine/google/appengine/tools/dev_appserver_main.py", line 82, in <module>
    from google.appengine.tools import appcfg
  File "/home/username/bin/google_appengine/google/appengine/tools/appcfg.py", line 53, in <module>
    from google.appengine.api import dosinfo
  File "/home/username/bin/google_appengine/google/appengine/api/dosinfo.py", line 25, in <module>
    import ipaddr
ImportError: No module named ipaddr
+3
source share
3 answers

This also happens with app-engine-patch

The solution is to add $GOOGLE_APP_ENGINE/lib/ipaddrto your pythonpath, as you should have done with other dependencies like antlr3 or yaml.

+3

http://code.google.com/p/ipaddr-py/ .

: http://code.google.com/p/google-app-engine-django/issues/detail?id=161#c3

google:

> Hi, just apply this patch from: http://code.google.com/p/google-app-engine-
django/source/detail?r=102

-------

Log message

Adds new dependency, ipaddr, from SDK
Affected files     expand all   collapse all
    Modify  /trunk/appengine_django/__init__.py diff
...         
129 129             SDK_PATH,
130 130             os.path.join(SDK_PATH, 'lib', 'antlr3'),
131 131             os.path.join(SDK_PATH, 'lib', 'django'),
132 +           os.path.join(SDK_PATH, 'lib', 'ipaddr'),
132 133             os.path.join(SDK_PATH, 'lib', 'webob'),
133 134             os.path.join(SDK_PATH, 'lib', 'yaml', 'lib'),
134 135         ]
+7

: http://code.google.com/appengine/articles/appengine_helper_for_django.html

, ipaddr . , D:\Python26\Lib\site-packages ipaddr.pth :

D:\Program Files\Google\google_appengine\lib\ipaddr

.

One more note: you do not need to install Python for Windows, as suggested, since it does not automatically pick up the appengine SDK (or at least it doesn't seem to me). Keep in mind that I have D: \ Program Files \ Google \ google_appengine \ in my system PATH variable, but I'm not sure if this helps (this means that I can run helper scripts there from cli).

+1
source

Source: https://habr.com/ru/post/1733948/


All Articles