'module' object has no attribute 'get_apps' with purchase order checkout

49 views
Skip to first unread message

lzantal

unread,
Apr 20, 2009, 12:12:13 PM4/20/09
to Satchmo users
Hi,

When I choose to checkout with purchase order I get this error:
AttributeError:
'module' object has no attribute 'get_apps'
it happens in python2.5/satchmo/apps/satchmo_utils/__init__.py in
app_enabled at line 30
"""
27. def app_enabled(appname):
28. """Check the app list to see if a named app is installed."""
29. all_apps = {}
30. for app in models.get_apps():
31. n = app.__name__.split('.')[-2]
32. if n == appname:
33. return True
34. return False
35.
"""

Thank you

lzantal

lzantal

unread,
Apr 23, 2009, 10:33:22 PM4/23/09
to Satchmo users
Hi,

Anyone have any idea on this?

Laszlo

Bob Waycott

unread,
Apr 24, 2009, 12:14:52 AM4/24/09
to satchm...@googlegroups.com
Can you provide some more details? What are your INSTALLED_APPS? What do you mean by you "choose to checkout with purchase order"?

Do you have custom apps installed? Custom payment modules?

Do you have a full Traceback available somewhere (like dpaste.com)?

Thanks,

Bob

Laszlo Antal

unread,
Apr 24, 2009, 4:28:21 PM4/24/09
to satchm...@googlegroups.com
Hi,

Thank you for the reply.
I will post the traceback and other info later today.

Thank you again

lzantal
> Laszlo Antal

akaihola

unread,
Jun 4, 2009, 5:31:29 PM6/4/09
to Satchmo users
Same issue here! I set some breakpoints with pdb, and strangely
enough, inside the app_enabled() function, "models" doesn't refer to
django.db.models but satchmo_utils.models!

Pdb reveals that "models" has the correct value at import time --
right after "from django.db import models" as well as at the very end
of the module. Only inside the function it points to the wrong module.

I posted a traceback at http://dpaste.com/hold/51617/

akaihola

unread,
Jun 4, 2009, 6:22:32 PM6/4/09
to Satchmo users
I removed satchmo_utils from INSTALLED_APPS and the error went away.
Somehow Django's INSTALLED_APPS magic messes up module lookup.

satchmo_utils provides some template tags, so in order to be able to
use them, satchmo_utils needs to be in INSTALLED_APPS.

The strange thing is, this same codebase currently runs fine on a
production server. Looks like I've some debugging to do...

akaihola

unread,
Jun 5, 2009, 5:17:59 AM6/5/09
to Satchmo users
It's a Django bug. See http://code.djangoproject.com/ticket/11264 and
use Django revision 10084 as a temporary solution.
Reply all
Reply to author
Forward
0 new messages