0
當我嘗試從表中獲取數據時,應用程序名稱會附加到表名稱並顯示錯誤。以下是我的代碼。應用程序名稱附加到django中的表名
from models import open_cart
class test(APIView):
def get(self,request,format=None):
values = open_cart.objects.get()
我在installed_apps中定義的應用程序名稱是'MyApp'。我的表名是'open_cart'。查詢中的表名稱將作爲MyApp_open_cart而不是open_cart。 我得到的錯誤信息是關係「untitled_open_cart」不存在
張貼您的模型和設置文件 – Exprator