Resolving AttributeError: __name__ ??

I am trying to connect to Microstrategy REST API server using below code of views.py.
But the import “from mstrio.cube import Cube” giving me AttributeError: name
The code runs fine in python. Even if i save the script as external and call from views.py its running. Direct running from views.py is throwing me this error.
Can anyone please help to fix it?

views.py code

from django.shortcuts import render
from mstrio.connection import Connection
from mstrio.cube import Cube

def home(request):
return render(request,‘home.html’,{“name”: “Saoni”})

def location (request):
mstr_username=request.POST.get(‘param1’)
mstr_password=request.POST.get(‘param2’)
location= request.POST.get(‘param3’)
base_url = “http://msappmstrprd013.lowes.com:8080/MicroStrategyLibrary/api
project_id = “2024B3DA11EAB4FA27A20080EF65F523” # hardcoded projectid
cube_id = “EA64A05E4D2184B18E7F2D830D2C9CFE” # hardcoded cubeid
conn = Connection(base_url, mstr_username, mstr_password, project_id=project_id)
conn.connect()
my_cube =Cube(connection=conn, cube_id=cube_id)
alldata= mstr_username+mstr_password+location+‘success’
return render(request,“home.html”,{‘data’: alldata})

Can you post the complete traceback from the error you’re getting? You probably also want to verify that the parameters you’re receiving from the POST are what you expect them to be.