Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pythonywhere没有看到db dajngo_Python_Django_Deployment_Pythonanywhere - Fatal编程技术网

Pythonywhere没有看到db dajngo

Pythonywhere没有看到db dajngo,python,django,deployment,pythonanywhere,Python,Django,Deployment,Pythonanywhere,我添加了virtualenv,启动了一个项目,通过迁移创建了db(sqlite)。当我试图通过postman获取信息时,我在/auth/login处得到一个操作错误,没有这样的表:client\u api\u profile。在bash中,我看到这个表存在,我做错了什么?您运行迁移了吗?在bash中访问的只是模型私有属性,而不是实际的数据库表。根据模型元类的Django文档: db_表 Options.db_table-用于模型的数据库表的名称: db_table = 'your_custom_

我添加了virtualenv,启动了一个项目,通过迁移创建了db(sqlite)。当我试图通过postman获取信息时,我在/auth/login处得到一个操作错误,没有这样的表:client\u api\u profile。在bash中,我看到这个表存在,我做错了什么?

您运行迁移了吗?在bash中访问的只是模型私有属性,而不是实际的数据库表。根据模型元类的Django文档:

db_表

Options.db_table-用于模型的数据库表的名称:

db_table = 'your_custom_table_name'

您运行过迁移吗?在bash中访问的只是模型私有属性,而不是实际的数据库表。根据模型元类的Django文档:

db_表

Options.db_table-用于模型的数据库表的名称:

db_table = 'your_custom_table_name'

这并不意味着该表存在,它只是Django将根据您配置模型的方式尝试使用的名称。这并不意味着该表存在,它只是Django将根据您配置模型的方式尝试使用的名称。Thx作为建议,我添加了这个,删除了数据库,通过迁移创建了新数据库,仍然不起作用。可能是因为PythonyWhere根本看不到数据库?如果您使用的是sqlite,请确保您认为您的web应用程序使用的数据库文件实际上就是它正在使用的数据库文件:Thx作为建议,我添加了这个,删除了数据库,通过迁移创建了新的数据库,仍然不起作用。可能是因为PythonyWhere根本看不到数据库?如果您使用的是sqlite,请确保您认为web应用程序正在使用的数据库文件实际上就是它正在使用的数据库文件: