Friday, 04 January, 2008

Django AttributeError: ‘module’ object has no attribute

If you get the error “AttributeError: ‘module’ object has no attribute ‘xyz’” in Django. It probably means you’ve added a new app but forgot to put the __init__.py file in the app’s directory.

Posted by simonb on 01/04 at 02:07 AM
DjangoProgrammingPermalinkEmail this bit
Thursday, 11 May, 2006

Django technical_500_response error

I recently switched from the Django magic-removal branch to the trunk post-magic-removal. I was getting this bizarre error:

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "/sw/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
    result = object(req)

  File "/Users/simonb/src/dj/trunk/django/core/handlers/modpython.py", line 157, in handler
    return ModPythonHandler()(req)

  File "/Users/simonb/src/dj/trunk/django/core/handlers/modpython.py", line 129, in __call__
    response = self.get_response(req.uri, request)

  File "/Users/simonb/src/dj/magic-removal/django/core/handlers/base.py", line 100, in get_response

  File "/Users/simonb/src/dj/magic-removal/django/core/handlers/base.py", line 133, in get_technical_error_response

  File "/Users/simonb/src/dj/trunk/django/views/debug.py", line 115, in technical_500_response
    c = Context({

IndexError: list index out of range

Well, it took me a while to figure out. Notice that the directory name used for the Django distribution changes in the traceback - from “trunk” to “magic-removal”. After I had updated I had changed the directory name from magic-removal to trunk. Ah ha! So a quick “find -name ‘*.pyc’ -exec rm {} \;” got rid of the compiled code with the old paths names. Now, at least, the errors make sense.

Posted by simonb on 05/11 at 07:46 AM
DjangoPythonComments (0) • Trackbacks (0) • PermalinkEmail this bit
Sunday, 07 May, 2006

Django Talk Video

Jacob Kaplan-Moss gave a talk on Django at Google for BayPIGgies.

Posted by simonb on 05/07 at 03:18 AM
DjangoPythonComments (0) • Trackbacks (0) • PermalinkEmail this bit
Sunday, 08 January, 2006

Django and Rails Creators Talk Video and Audio

Snakes and Rubies Chicago, 3 Dec. 2005: The creators of Django and Rails each gave talks and discussed web frameworks. Download the video and audio here

Posted by simonb on 01/08 at 08:50 AM
DjangoProgrammingPythonComments (0) • Trackbacks (0) • PermalinkEmail this bit

Page 1 of 1 pages