One of the things I’m trying to accomplish is procedural app calls. To do this, I have this bit of code:
from .models import Page
def index(request, pagename):
# Lots of bits are cut out for sake of relevancy
page = Page.objects.get(permalink=pagename)
if page.app != 'pages':
package = __import__(f'{page.app}.views')
return package.views.index(request, page)
However, it’s giving me a strange error. When I initially wrote this code, it worked just fine, but after transferring to another computer it throws the following error and stack trace (I tried doing the same thing in the django shell just to get really specific):
I’ve been scratching my head for days and can’t figure it out, if anyone knows what’s going on here I’d be really appreciative!