'module' object has no attribute 'ROOT_URLCONF'

829 views
Skip to first unread message

nathanaeljones

unread,
Jun 30, 2008, 11:42:39 AM6/30/08
to Google App Engine
I have a django-based app I've been developing on the app framework
locally. It works fine locally, but I get the following error when I
upload it to the site:



<type 'exceptions.AttributeError'>: 'module' object has no attribute
'ROOT_URLCONF'
Traceback (most recent call last):
File "/base/data/home/apps/micomments/1.3/django_bootstrap.py", line
66, in <module>
main()
File "/base/data/home/apps/micomments/1.3/django_bootstrap.py", line
63, in main
util.run_wsgi_app(application)
File "/base/python_lib/versions/1/google/appengine/ext/webapp/
util.py", line 76, in run_wsgi_app
result = application(env, _start_response)
File "/base/python_lib/versions/1/django/core/handlers/wsgi.py",
line 189, in __call__
response = self.get_response(request)
File "/base/python_lib/versions/1/django/core/handlers/base.py",
line 64, in get_response
urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
File "/base/python_lib/versions/1/django/conf/__init__.py", line 32,
in __getattr__
return getattr(self._target, name)
File "/base/python_lib/versions/1/django/conf/__init__.py", line
133, in __getattr__
return getattr(self.default_settings, name)


app.yaml points all requests to django_bootstrap.py

Which has this code:


# Force sys.path to have our own directory first, so we can import
from it.
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))

# Must set this env var *before* importing any part of Django.
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

My settings.py file seems to be well formed (I have made very few
changes from the django sample project posted by google.)

Any ideas why it would work locally but not on the server?

Nathanael D. Jones

unread,
Jun 30, 2008, 1:55:25 PM6/30/08
to Google App Engine
I used the sample django project. I tried using main.py from http://code.google.com/appengine/articles/django.html, but I recieved this error when I tried that:

AssertionError at /

Won't override attribute 'make_value_from_form'

Request Method: GET
Request URL: http://micomments.com/
Exception Type: AssertionError
Exception Value: Won't override attribute 'make_value_from_form'
Exception Location: /base/python_lib/versions/1/google/appengine/ext/db/djangoforms.py in monkey_patch, line 127

Traceback (innermost last)


  • /base/python_lib/versions/1/django/core/handlers/base.py in get_response
    1. return response

    2. # Get urlconf from request object, if available. Otherwise use default.
    1. urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)

    1. resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
    2. try:
    1. callback, callback_args, callback_kwargs = resolver.resolve(request.path) ...

    1. # Apply view middleware
    2. for middleware_method in self._view_middleware:
    3. response = middleware_method(request, callback, callback_args, callback_kwargs)
    4. if response:
    5. return response
    Variable
    Value
    debug
    <module 'django.views.debug' from '/base/python_lib/versions/1/django/views/debug.py'>

    exceptions
    <module 'django.core.exceptions' from '/base/python_lib/versions/1/django/core/exceptions.py'>

    mail_admins
    <function mail_admins at 0x2b62f9e1da698c18>

    request
    <WSGIRequest GET:<MultiValueDict: {}>, POST:<MultiValueDict: {}>, COOKIES:{}, META:{'AUTH_DOMAIN': 'gmail.com', 'CURRENT_VERSION_ID': '1.5', 'DJANGO_SETTINGS_MODULE': 'settings', 'HTTP_ACCEPT': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_HOST': 'micomments.com', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12,gzip(gfe),gzip(gfe)', 'PATH_INFO': '/', 'PATH_TRANSLATED': '/base/data/home/apps/micomments/1.5/django_bootstrap_2.py', 'QUERY_STRING': '', 'REMOTE_ADDR': '99.130.219.29', 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'micomments.com', 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'Google Apphosting/1.0', 'TZ': 'America/Kentucky/Louisville', 'USER': 'apphosting', 'USER_EMAIL': '', 'USER_IS_ADMIN': '0', 'USER_NICKNAME': '', 'wsgi.errors': <cStringIO.StringO object at 0x2b62f9e1da3a6850>, 'wsgi.input': <cStringIO.StringI object at 0x2b62f9e1da357488>, 'wsgi.multiprocess': False, 'wsgi.multithread': False, 'wsgi.run_once': True, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}>

    resolver
    <django.core.urlresolvers.RegexURLResolver object at 0x2b62f9e1da37d3b8>

    self
    <django.core.handlers.wsgi.WSGIHandler object at 0x2b62f9e1da374f38>

    settings
    <django.conf.LazySettings object at 0x2b62f9e1da3353b8>

    urlconf
    'urls'

    urlresolvers
    <module 'django.core.urlresolvers' from '/base/python_lib/versions/1/django/core/urlresolvers.py'>

  • /base/python_lib/versions/1/django/core/urlresolvers.py in resolve
    1. self.default_kwargs = default_kwargs or {}

    2. def resolve(self, path):
    3. tried = []
    4. match = self.regex.search(path)
    5. if match:
    6. new_path = path[match.end():]
    1. for pattern in self.urlconf_module.urlpatterns: ...
    1. try:
    2. sub_match = pattern.resolve(new_path)
    3. except Resolver404, e:
    4. tried.extend([(pattern.regex.pattern + ' ' + t) for t in e.args[0]['tried']])
    5. else:
    6. if sub_match:
    Variable
    Value
    match
    <_sre.SRE_Match object at 0x2b62f9e1da376960>

    new_path
    ''

    path
    '/'

    self
    <django.core.urlresolvers.RegexURLResolver object at 0x2b62f9e1da37d3b8>

    tried
    []

  • /base/python_lib/versions/1/django/core/urlresolvers.py in _get_urlconf_module
    1. raise Resolver404, {'tried': tried, 'path': new_path}

    2. def _get_urlconf_module(self):
    3. try:
    4. return self._urlconf_module
    5. except AttributeError:
    6. try:
    1. self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) ...
    1. except ValueError, e:
    2. # Invalid urlconf_name, such as "foo.bar." (note trailing period)
    3. raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
    4. return self._urlconf_module
    5. urlconf_module = property(_get_urlconf_module)

    Variable
    Value
    self
    <django.core.urlresolvers.RegexURLResolver object at 0x2b62f9e1da37d3b8>

  • /base/data/home/apps/micomments/1.5/urls.py in
    1. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    2. # See the License for the specific language governing permissions and
    3. # limitations under the License.


    4. from django.conf.urls.defaults import *

    1. from views import * ...
    1. from models import *
    2. from scriptviews import *

    3. urlpatterns = patterns(
    4. '',
    5. (r'^$', 'views.home' ),
    Variable
    Value
    __builtins__
    {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, 'Exception': <type 'exceptions.Exception'>, 'False': False, 'FloatingPointError': <type 'exceptions.FloatingPointError'>, 'FutureWarning': <type 'exceptions.FutureWarning'>, 'GeneratorExit': <type 'exceptions.GeneratorExit'>, 'IOError': <type 'exceptions.IOError'>, 'ImportError': <type 'exceptions.ImportError'>, 'ImportWarning': <type 'exceptions.ImportWarning'>, 'IndentationError': <type 'exceptions.IndentationError'>, 'IndexError': <type 'exceptions.IndexError'>, 'KeyError': <type 'exceptions.KeyError'>, 'KeyboardInterrupt': <type 'exceptions.KeyboardInterrupt'>, 'LookupError': <type 'exceptions.LookupError'>, 'MemoryError': <type 'exceptions.MemoryError'>, 'NameError': <type 'exceptions.NameError'>, 'None': None, 'NotImplemented': NotImplemented, 'NotImplementedError': <type 'exceptions.NotImplementedError'>, 'OSError': <type 'exceptions.OSError'>, 'OverflowError': <type 'exceptions.OverflowError'>, 'PendingDeprecationWarning': <type 'exceptions.PendingDeprecationWarning'>, 'ReferenceError': <type 'exceptions.ReferenceError'>, 'RuntimeError': <type 'exceptions.RuntimeError'>, 'RuntimeWarning': <type 'exceptions.RuntimeWarning'>, 'StandardError': <type 'exceptions.StandardError'>, 'StopIteration': <type 'exceptions.StopIteration'>, 'SyntaxError': <type 'exceptions.SyntaxError'>, 'SyntaxWarning': <type 'exceptions.SyntaxWarning'>, 'SystemError': <type 'exceptions.SystemError'>, 'SystemExit': <type 'exceptions.SystemExit'>, 'TabError': <type 'exceptions.TabError'>, 'True': True, 'TypeError': <type 'exceptions.TypeError'>, 'UnboundLocalError': <type 'exceptions.UnboundLocalError'>, 'UnicodeDecodeError': <type 'exceptions.UnicodeDecodeError'>, 'UnicodeEncodeError': <type 'exceptions.UnicodeEncodeError'>, 'UnicodeError': <type 'exceptions.UnicodeError'>, 'UnicodeTranslateError': <type 'exceptions.UnicodeTranslateError'>, 'UnicodeWarning': <type 'exceptions.UnicodeWarning'>, 'UserWarning': <type 'exceptions.UserWarning'>, 'ValueError': <type 'exceptions.ValueError'>, 'Warning': <type 'exceptions.Warning'>, 'ZeroDivisionError': <type 'exceptions.ZeroDivisionError'>, '_': <function gettext at 0x2b62f9e1da6b4120>, '__debug__': True, '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__import__': <built-in function __import__>, '__name__': '__builtin__', 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'apply': <built-in function apply>, 'basestring': <type 'basestring'>, 'bool': <type 'bool'>, 'buffer': <type 'buffer'>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'classmethod': <type 'classmethod'>, 'cmp': <built-in function cmp>, 'coerce': <built-in function coerce>, 'compile': <built-in function compile>, 'complex': <type 'complex'>, 'copyright': Copyright (c) 2001-2008 Python Software Foundation. All Rights Reserved. Copyright (c) 2000 BeOpen.com. All Rights Reserved. Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved. Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved., 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information., 'delattr': <built-in function delattr>, 'dict': <type 'dict'>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'enumerate': <type 'enumerate'>, 'eval': <built-in function eval>, 'execfile': <built-in function execfile>, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'file': <type 'file'>, 'filter': <built-in function filter>, 'float': <type 'float'>, 'frozenset': <type 'frozenset'>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'help': Type help() for interactive help, or help(object) for help about object., 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'int': <type 'int'>, 'intern': <built-in function intern>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'license': Type license() to see the full license text, 'list': <type 'list'>, 'locals': <built-in function locals>, 'long': <type 'long'>, 'map': <built-in function map>, 'max': <built-in function max>, 'min': <built-in function min>, 'object': <type 'object'>, 'oct': <built-in function oct>, 'open': <built-in function open>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'property': <type 'property'>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'range': <built-in function range>, 'raw_input': <built-in function raw_input>, 'reduce': <built-in function reduce>, 'reload': <built-in function reload>, 'repr': <built-in function repr>, 'reversed': <type 'reversed'>, 'round': <built-in function round>, 'set': <type 'set'>, 'setattr': <built-in function setattr>, 'slice': <type 'slice'>, 'sorted': <built-in function sorted>, 'staticmethod': <type 'staticmethod'>, 'str': <type 'str'>, 'sum': <built-in function sum>, 'super': <type 'super'>, 'tuple': <type 'tuple'>, 'type': <type 'type'>, 'unichr': <built-in function unichr>, 'unicode': <type 'unicode'>, 'vars': <built-in function vars>, 'xrange': <type 'xrange'>, 'zip': <built-in function zip>}

    __doc__
    None

    __file__
    None

    __name__
    None

    handler404
    None

    handler500
    None

    include
    None

    patterns
    None

  • /base/python_lib/versions/1/google/appengine/ext/db/djangoforms.py in
    1. assert name not in base.__dict__, "Won't override attribute %r" % (name,)
    2. setattr(base, name, value)
    3. return base




    1. class Property(db.Property): ...
    1. __metaclass__ = monkey_patch

    2. def get_form_field(self, form_class=forms.CharField, **kwargs):
    3. """Return a Django form field appropriate for this property.

    4. Args:
    Variable
    Value
    __builtins__
    {'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException': <type 'exceptions.BaseException'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, 'Exception': <type 'exceptions.Exception'>, 'False': False, 'FloatingPointError': <type 'exceptions.FloatingPointError'>, 'FutureWarning': <type 'exceptions.FutureWarning'>, 'GeneratorExit': <type 'exceptions.GeneratorExit'>, 'IOError': <type 'exceptions.IOError'>, 'ImportError': <type 'exceptions.ImportError'>, 'ImportWarning': <type 'exceptions.ImportWarning'>, 'IndentationError': <type 'exceptions.IndentationError'>, 'IndexError': <type 'exceptions.IndexError'>, 'KeyError': <type 'exceptions.KeyError'>, 'KeyboardInterrupt': <type 'exceptions.KeyboardInterrupt'>, 'LookupError': <type 'exceptions.LookupError'>, 'MemoryError': <type 'exceptions.MemoryError'>, 'NameError': <type 'exceptions.NameError'>, 'None': None, 'NotImplemented': NotImplemented, 'NotImplementedError': <type 'exceptions.NotImplementedError'>, 'OSError': <type 'exceptions.OSError'>, 'OverflowError': <type 'exceptions.OverflowError'>, 'PendingDeprecationWarning': <type 'exceptions.PendingDeprecationWarning'>, 'ReferenceError': <type 'exceptions.ReferenceError'>, 'RuntimeError': <type 'exceptions.RuntimeError'>, 'RuntimeWarning': <type 'exceptions.RuntimeWarning'>, 'StandardError': <type 'exceptions.StandardError'>, 'StopIteration': <type 'exceptions.StopIteration'>, 'SyntaxError': <type 'exceptions.SyntaxError'>, 'SyntaxWarning': <type 'exceptions.SyntaxWarning'>, 'SystemError': <type 'exceptions.SystemError'>, 'SystemExit': <type 'exceptions.SystemExit'>, 'TabError': <type 'exceptions.TabError'>, 'True': True, 'TypeError': <type 'exceptions.TypeError'>, 'UnboundLocalError': <type 'exceptions.UnboundLocalError'>, 'UnicodeDecodeError': <type 'exceptions.UnicodeDecodeError'>, 'UnicodeEncodeError': <type 'exceptions.UnicodeEncodeError'>, 'UnicodeError': <type 'exceptions.UnicodeError'>, 'UnicodeTranslateError': <type 'exceptions.UnicodeTranslateError'>, 'UnicodeWarning': <type 'exceptions.UnicodeWarning'>, 'UserWarning': <type 'exceptions.UserWarning'>, 'ValueError': <type 'exceptions.ValueError'>, 'Warning': <type 'exceptions.Warning'>, 'ZeroDivisionError': <type 'exceptions.ZeroDivisionError'>, '_': <function gettext at 0x2b62f9e1da6b4120>, '__debug__': True, '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__import__': <built-in function __import__>, '__name__': '__builtin__', 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'apply': <built-in function apply>, 'basestring': <type 'basestring'>, 'bool': <type 'bool'>, 'buffer': <type 'buffer'>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'classmethod': <type 'classmethod'>, 'cmp': <built-in function cmp>, 'coerce': <built-in function coerce>, 'compile': <built-in function compile>, 'complex': <type 'complex'>, 'copyright': Copyright (c) 2001-2008 Python Software Foundation. All Rights Reserved. Copyright (c) 2000 BeOpen.com. All Rights Reserved. Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved. Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved., 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information., 'delattr': <built-in function delattr>, 'dict': <type 'dict'>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'enumerate': <type 'enumerate'>, 'eval': <built-in function eval>, 'execfile': <built-in function execfile>, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'file': <type 'file'>, 'filter': <built-in function filter>, 'float': <type 'float'>, 'frozenset': <type 'frozenset'>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'help': Type help() for interactive help, or help(object) for help about object., 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'int': <type 'int'>, 'intern': <built-in function intern>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'license': Type license() to see the full license text, 'list': <type 'list'>, 'locals': <built-in function locals>, 'long': <type 'long'>, 'map': <built-in function map>, 'max': <built-in function max>, 'min': <built-in function min>, 'object': <type 'object'>, 'oct': <built-in function oct>, 'open': <built-in function open>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'property': <type 'property'>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'range': <built-in function range>, 'raw_input': <built-in function raw_input>, 'reduce': <built-in function reduce>, 'reload': <built-in function reload>, 'repr': <built-in function repr>, 'reversed': <type 'reversed'>, 'round': <built-in function round>, 'set': <type 'set'>, 'setattr': <built-in function setattr>, 'slice': <type 'slice'>, 'sorted': <built-in function sorted>, 'staticmethod': <type 'staticmethod'>, 'str': <type 'str'>, 'sum': <built-in function sum>, 'super': <type 'super'>, 'tuple': <type 'tuple'>, 'type': <type 'type'>, 'unichr': <built-in function unichr>, 'unicode': <type 'unicode'>, 'vars': <built-in function vars>, 'xrange': <type 'xrange'>, 'zip': <built-in function zip>}

    __doc__
    None

    __file__
    None

    __name__
    None

    db
    None

    django
    None

    forms
    None

    monkey_patch
    None

    users
    None

  • /base/python_lib/versions/1/google/appengine/ext/db/djangoforms.py in monkey_patch
    1. it is recommended to give PatchClass the same name as TargetClass.
    2. """

    3. assert len(bases) == 1, 'Exactly one base class is required'
    4. base = bases[0]
    5. for name, value in namespace.iteritems():
    6. if name not in ('__metaclass__', '__module__'):
    1. assert name not in base.__dict__, "Won't override attribute %r" % (name,) ...
    1. setattr(base, name, value)
    2. return base





jack

unread,
Jul 10, 2008, 1:21:23 PM7/10/08
to Google App Engine
I'm going through some examples and just ran across this error as
well:

AssertionError at /
Won't override attribute 'make_value_from_form'
Request Method: GET
Request URL: http://localhost:8080/
Exception Type: AssertionError
Exception Value: Won't override attribute 'make_value_from_form'
Exception Location: C:\Program Files\Google\google_appengine\google
\appengine\ext\db\djangoforms.py in monkey_patch, line 127

Could anyone point me in the right direction on this?



On Jun 30, 1:55 pm, "Nathanael D. Jones" <nathanael.jo...@gmail.com>
wrote:
> I used the sample django project. I tried using main.py fromhttp://code.google.com/appengine/articles/django.html, but I recieved this
> error when I tried that:
>
> AssertionError at / Won't override attribute 'make_value_from_form' Request
> Method: GET Request URL:http://micomments.com/ Exception Type:
> AssertionError Exception Value: Won't override attribute
> 'make_value_from_form' Exception Location:
> /base/python_lib/versions/1/google/appengine/ext/db/djangoforms.py
> in monkey_patch, line 127
> Traceback (innermost last) Switch to copy-and-paste
> view<http://micomments.com/#>
>
> - /base/python_lib/versions/1/django/core/handlers/base.py in
> get_response
> 1. return response
> 2.
> 3. # Get urlconf from request object, if available. Otherwise use
> default.
> 4. urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
> 5.
> 6. resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
> 7. try:
> 1. callback, callback_args, callback_kwargs =
> resolver.resolve(request.path) ...
> 1.
> 2. # Apply view middleware
> 3. for middleware_method in self._view_middleware:
> 4. response = middleware_method(request, callback, callback_args,
> callback_kwargs)
> 5. if response:
> 6. return response
> ▶ Local vars <http://micomments.com/#>
> - /base/python_lib/versions/1/django/core/urlresolvers.py in resolve
> 1. self.default_kwargs = default_kwargs or {}
> 2.
> 3. def resolve(self, path):
> 4. tried = []
> 5. match = self.regex.search(path)
> 6. if match:
> 7. new_path = path[match.end():]
> 1. for pattern in self.urlconf_module.urlpatterns: ...
> 1. try:
> 2. sub_match = pattern.resolve(new_path)
> 3. except Resolver404, e:
> 4. tried.extend([(pattern.regex.pattern + ' ' + t) for t in
> e.args[0]['tried']])
> 5. else:
> 6. if sub_match:
> ▶ Local vars <http://micomments.com/#>
> Variable
> Value
> match
> <_sre.SRE_Match object at 0x2b62f9e1da376960>
>
> new_path
> ''
>
> path
> '/'
>
> self
> <django.core.urlresolvers.RegexURLResolver object at 0x2b62f9e1da37d3b8>
>
> tried
> []
>
> - /base/python_lib/versions/1/django/core/urlresolvers.py in
> _get_urlconf_module
> 1. raise Resolver404, {'tried': tried, 'path': new_path}
> 2.
> 3. def _get_urlconf_module(self):
> 4. try:
> 5. return self._urlconf_module
> 6. except AttributeError:
> 7. try:
> 1. self._urlconf_module = __import__(self.urlconf_name, {}, {}, [''])
> ...
> 1. except ValueError, e:
> 2. # Invalid urlconf_name, such as "foo.bar." (note trailing period)
> 3. raise ImproperlyConfigured, "Error while importing URLconf %r: %s"
> % (self.urlconf_name, e)
> 4. return self._urlconf_module
> 5. urlconf_module = property(_get_urlconf_module)
> 6.
> ▶ Local vars <http://micomments.com/#>
> Variable
> Value
> self
> <django.core.urlresolvers.RegexURLResolver object at 0x2b62f9e1da37d3b8>
>
> - /base/data/home/apps/micomments/1.5/urls.py in
> 1. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> 2. # See the License for the specific language governing permissions
> and
> 3. # limitations under the License.
> 4.
> 5.
> 6. from django.conf.urls.defaults import *
> 7.
> 1. from views import * ...
> 1. from models import *
> 2. from scriptviews import *
> 3.
> 4. urlpatterns = patterns(
> 5. '',
> 6. (r'^$', 'views.home' ),
> ▶ Local vars <http://micomments.com/#>
> Seewww.python.orgfor more information., 'delattr': <built-in function
> - /base/python_lib/versions/1/google/appengine/ext/db/djangoforms.py in
>
> 1. assert name not in base.__dict__, "Won't override attribute %r" %
> (name,)
> 2. setattr(base, name, value)
> 3. return base
> 4.
> 5.
> 6.
> 7.
> 1. class Property(db.Property): ...
> 1. __metaclass__ = monkey_patch
> 2.
> 3. def get_form_field(self, form_class=forms.CharField, **kwargs):
> 4. """Return a Django form field appropriate for this property.
> 5.
> 6. Args:
> ▶ Local vars <http://micomments.com/#>
> Seewww.python.orgfor more information., 'delattr': <built-in function
> - /base/python_lib/versions/1/google/appengine/ext/db/djangoforms.py in
> monkey_patch
> 1. it is recommended to give PatchClass the same name as TargetClass.
> 2. """
> 3.
> 4. assert len(bases) == 1, 'Exactly one base class is required'
> 5. base = bases[0]
> 6. for name, value in namespace.iteritems():
> 7. if name not in ('__metaclass__', '__module__'):
> 1. assert name not in base.__dict__, "Won't override attribute %r" %
> (name,) ...
> 1. setattr(base, name, value)
> 2. return base
> 3.
> 4.
> 5.
> 6.
> ▶ <http://micomments.com/#>

huangmantao

unread,
Jul 16, 2008, 5:31:16 AM7/16/08
to Google App Engine
I have the same problem.
Waiting for any solution.

Wuming Gong

unread,
Jul 29, 2008, 6:05:17 PM7/29/08
to Google App Engine
Me too. It disappear after I restart the dev engine server, though.

Wuming

On Jul 10, 12:21 pm, jack <jack.bish...@gmail.com> wrote:
> I'm going through some examples and just ran across this error as
> well:
>
> AssertionError at /
> Won't override attribute 'make_value_from_form'
> Request Method: GET
> Request URL: http://localhost:8080/
> Exception Type: AssertionError
> Exception Value: Won't override attribute 'make_value_from_form'
> Exception Location: C:\Program Files\Google\google_appengine\google
> \appengine\ext\db\djangoforms.py in monkey_patch, line 127
>
> Could anyone point me in the right direction on this?
>
> On Jun 30, 1:55 pm, "Nathanael D. Jones" <nathanael.jo...@gmail.com>
> wrote:
>
> > I used the sample django project. I tried using main.py fromhttp://code.google.com/appengine/articles/django.html, but I recieved this
> > error when I tried that:
>
> > AssertionError at / Won't override attribute 'make_value_from_form' Request
> > Method: GET Request URL:http://micomments.com/Exception Type:
> ...
>
> read more >>

lee...@gmail.com

unread,
Aug 1, 2008, 12:35:43 AM8/1/08
to Google App Engine
try this:

add this line "django_bootstrap.py" in your django_bootstrap.py
> ...
>
> read more >>

Wes

unread,
Aug 24, 2008, 2:10:31 AM8/24/08
to Google App Engine
I've received this error as well, same pattern: works locally but
breaks when uploaded to GAE.

Were you able to resolve this?

Note: I have received this locally a couple times but restarting the
server seems to do the trick.

leezjs: what is meant by your suggestion "add this line
"django_bootstrap.py" in your django_bootstrap.py". Where are you
suggesting I add that line? Some setting? I'm new to GAE and python so
forgive me if this is an obvious newb question.

Wes



On Jul 31, 11:35 pm, "lee...@gmail.com" <lee...@gmail.com> wrote:
> try this:
>
> add this line "django_bootstrap.py" in your django_bootstrap.py
>
> On Jul 30, 6:05 am, Wuming Gong <Wuming.G...@gmail.com> wrote:
>
> > Me too. It disappear after I restart the dev engine server, though.
>
> > Wuming
>
> > On Jul 10, 12:21 pm, jack <jack.bish...@gmail.com> wrote:
>
> > > I'm going through some examples and just ran across this error as
> > > well:
>
> > > AssertionError at /
> > > Won't overrideattribute'make_value_from_form'
> > > Request Method: GET
> > > Request URL: http://localhost:8080/
> > > Exception Type: AssertionError
> > > Exception Value: Won't overrideattribute'make_value_from_form'
> > > Exception Location: C:\Program Files\Google\google_appengine\google
> > > \appengine\ext\db\djangoforms.py in monkey_patch, line 127
>
> > > Could anyone point me in the right direction on this?
>
> > > On Jun 30, 1:55 pm, "Nathanael D. Jones" <nathanael.jo...@gmail.com>
> > > wrote:
>
> > > > I used the sample django project. I tried using main.py fromhttp://code.google.com/appengine/articles/django.html, but I recieved this
> > > > error when I tried that:
>
> > > > AssertionError at / Won't overrideattribute'make_value_from_form' Request
> > > > Method: GET Request URL:http://micomments.com/ExceptionType:
> > > > AssertionError Exception Value: Won't overrideattribute
> > > > 'make_value_from_form' Exception Location:
> > > > /base/python_lib/versions/1/google/appengine/ext/db/djangoforms.py
> > > > in monkey_patch, line 127
> > > > Traceback (innermost last) Switch to copy-and-paste
> > > > view<http://micomments.com/#>
>
> > > > - /base/python_lib/versions/1/django/core/handlers/base.py in
> > > > get_response
> > > > 1. return response
> > > > 2.
> > > > 3. # Get urlconf from requestobject, if available. Otherwise use
> > > > <django.conf.LazySettingsobjectat 0x2b62f9e1da3353b8>
> > > > <_sre.SRE_Matchobjectat 0x2b62f9e1da376960>
>
> > > > new_path
> > > > ''
>
> > > > path
> > > > '/'
>
> > > > self
> > > > <django.core.urlresolvers.RegexURLResolverobjectat 0x2b62f9e1da37d3b8>
>
> > > > tried
> > > > []
>
> > > > - /base/python_lib/versions/1/django/core/urlresolvers.py in
> > > > _get_urlconf_module
> > > > 1. raise Resolver404, {'tried': tried, 'path': new_path}
> > > > 2.
> > > > 3. def _get_urlconf_module(self):
> > > > 4. try:
> > > > 5. return self._urlconf_module
> > > > 6. except AttributeError:
> > > > 7. try:
> > > > 1. self._urlconf_module = __import__(self.urlconf_name, {}, {}, [''])
> > > > ...
> > > > 1. except ValueError, e:
> > > > 2. # Invalid urlconf_name, such as "foo.bar." (note trailing period)
> > > > 3. raise ImproperlyConfigured, "Error while importing URLconf %r: %s"
> > > > % (self.urlconf_name, e)
> > > > 4. return self._urlconf_module
> > > > 5. urlconf_module = property(_get_urlconf_module)
> > > > 6.
> > > > ▶ Local vars <http://micomments.com/#>
> > > > Variable
> > > > Value
> > > > self
> > > > <django.core.urlresolvers.RegexURLResolverobjectat 0x2b62f9e1da37d3b8>
> ...
>
> read more >>

Wes

unread,
Aug 24, 2008, 10:18:28 PM8/24/08
to Google App Engine
After searching for several hours I found this:
http://thomas.broxrost.com/2008/04/08/django-on-google-app-engine/

This version works right out-of-the-box with GAE. After some diffing I
narrowed it down to these lines:
# Force Django to reload its settings.
from django.conf import settings
settings._target = None


These lines do appear in these instructions http://code.google.com/appengine/articles/django.html
but I couldn't get those instructions to work when I first started
last week (I can't remember why now).

This sample was the first to work locally:
http://google-app-engine-samples.googlecode.com/files/django_example_20080409.tar.gz

After adding those 3 reload lines to the sample tar, it works great
uploaded to GAE.

Huzzah!
> ...
>
> read more >>

Juha

unread,
Sep 12, 2008, 5:59:37 PM9/12/08
to Google App Engine
In my case the solution was to put:
from google.appengine.ext.webapp import template

to my bforms.py file. I don't know why, but this document
http://code.google.com/appengine/articles/djangoforms.html says;
"Please note that you must import google.appengine.webapp.template
before importing any Django modules."

So after the changes, my bforms.py looks like this:

from google.appengine.ext.webapp import template
import models

from google.appengine.ext.db import djangoforms
class BookForm(djangoforms.ModelForm):
class Meta:
model = models.Book
exclude = ['created_by']


Br,
Juha
Reply all
Reply to author
Forward
0 new messages