我无法卸载Django应用。我删除了代码中的每个应用程序,删除了所有模型和网址。然后,我从settings.py
删除了部分应用,但在我为settings.py
删除它时会出现错误。
它可能与迁移有关,但我没有得到它,因为所有迁移都已迁移...
这是一个追溯:
Unhandled exception in thread started by <function wrapper at 0x038E6130>
Traceback (most recent call last):
File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\venv\lib\site-packages\django\utils\autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\venv\lib\site-packages\django\core\management\commands\runserver.py", line 116, in inner_run
self.check_migrations()
File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\venv\lib\site-packages\django\core\management\commands\runserver.py", line 168, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\venv\lib\site-packages\django\db\migrations\executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\venv\lib\site-packages\django\db\migrations\loader.py", line 47, in __init__
self.build_graph()
File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\venv\lib\site-packages\django\db\migrations\loader.py", line 314, in build_graph
parent = self.check_key(parent, key[0])
File "C:\Users\Milano\PycharmProjects\FutileStudio\SolutionsForLanguages_2\venv\lib\site-packages\django\db\migrations\loader.py", line 176, in check_key
raise ValueError("Dependency on unknown app: %s" % key[0])
ValueError: Dependency on unknown app: quiz
答案 0 :(得分:0)
迁移文件存在问题,其中包含已卸载的应用程序的参考。
这可能不是最好的方法,但它有效: