我正在使用命令django-admin.py startapp new_app
部署新的django new_app
,并将其添加到settings.py
中已安装的应用中。然后在makemigrations
和migrate
命令之后一切都很好。现在我需要从GitHub复制文件并用它们替换默认的new_app
文件夹。
我从new_app
文件夹exept默认迁移(这是对吗?)中删除所有内容,并从相关克隆的GitHub文件夹中删除迁移,并将其他所有内容复制到new_app文件夹。所以,dafault唯一剩下的就是迁移。
在这些操作之后makemirgations
命令响应以下回溯:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/django/django_project/denv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/home/django/django_project/denv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute
django.setup()
File "/home/django/django_project/denv/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/django/django_project/denv/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/django/django_project/denv/local/lib/python2.7/site-packages/django/apps/config.py", line 86, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named `new_app`