我正在使用virtualenv在python 3.4上运行Django 1.9。它一直在工作,但今天,它不是。
当我运行./manage.py runserver时,出现以下错误:
(django1)dan@danvb:~/Share/django1/suorganizer$ ./manage.py runserver Performing system checks... System check identified no issues (0 silenced). Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f48a01d2c80> Traceback (most recent call last): File "/home/dan/Share/django1/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/home/dan/Share/django1/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run self.check_migrations() File "/home/dan/Share/django1/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 163, in check_migrations executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS]) File "/home/dan/Share/django1/lib/python3.4/site-packages/django/db/migrations/executor.py", line 20, in __init__ self.loader = MigrationLoader(self.connection) File "/home/dan/Share/django1/lib/python3.4/site-packages/django/db/migrations/loader.py", line 49, in __init__ self.build_graph() File "/home/dan/Share/django1/lib/python3.4/site-packages/django/db/migrations/loader.py", line 170, in build_graph self.load_disk() File "/home/dan/Share/django1/lib/python3.4/site-packages/django/db/migrations/loader.py", line 105, in load_disk migration_module = import_module("%s.%s" % (module_name, migration_name)) File "/home/dan/Share/django1/lib/python3.4/importlib/__init__.py", line 109, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 2254, in _gcd_import File "<frozen importlib._bootstrap>", line 2237, in _find_and_load File "<frozen importlib._bootstrap>", line 2212, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 2254, in _gcd_import File "<frozen importlib._bootstrap>", line 2237, in _find_and_load File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked ImportError: No module named 'core.migrations.delete'
我卸载并重新安装了Django == 1.9,并得到了同样的错误。在lib / python3.4 / site-packages / django / core /中,我没有迁移目录。我不知道该找什么。不久前,命令./manage.py runserver在这个项目上为我工作。
谢谢。
答案 0 :(得分:0)
解决。
我有一个Django迁移文件夹,core / migrations /,而不是实际删除迁移模块,我将其重命名为xxx.delete,我想我可能想要恢复它。在实际删除该模块后,我的ImportError已解决。