tags:

views:

59

answers:

1
+3  A: 

class Item_list():

You can't include an empty inheritance list in Python 2.3. There seems to have been a change in the grammar that allows it now but not then.

It would normally be written:

class Item_list:

if you don't want any base classes. But generally these days you'd want to derive from object to get new-style classes.

I don't know much about your deployment environment, but in general when you've tried to import something and got an exception, it can leave behind partially-initialised modules in sys.modules that will frustrate future attempts to import them, resulting in otherwise inexplicable errors where properties and actions of the module are not where they were expected.

In general once an import has failed you should consider the environment lost and start again, but I don't know how your Django deployment copes with errors like that and process-restarting issues. Maybe the original error has left an interpreter running without having written the expected stuff to url_patterns, or something.

bobince
I think I'm running into that now. Now I'm getting errors that types aren't found when I'm clearly importing them. I do pkill python, but is there something else I need to do?
victor
You might have to restart the server. I don't know how you're deploying your app; does the fastcgi server have embedded Python interpreters, for example, that aren't launched as separate 'python' processes pkill would catch? Configuring servers to correctly respond to their scripts being changed isn't standardised but there should be *some* way to do it...
bobince