Django ImportError:没有名为“ webapp_credentials”的模块

时间:2019-10-28 13:51:22

标签: django python-3.x vagrant

我正在运行以下代码:

https://github.com/cndreisbach/call-for-service/blob/master/docs/src/development.md

当我在Vagrant shell中运行这部分代码时:

python3 ./cfs/manage.py migrate --settings=cfs.settings.local

这是在回信我没有"ImportError: No module named 'webapp_credentials'"

这是错误:

Traceback (most recent call last):
  File "./cfs/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 351, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 985, in _gcd_import
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 697, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/vagrant/cfs/cfs/settings/local.py", line 1, in <module>
    from .base import *
  File "/vagrant/cfs/cfs/settings/base.py", line 15, in <module>
    from webapp_credentials import creds
ImportError: No module named 'webapp_credentials'

webapp_credentials是python OS的模块,我该如何解决?

1 个答案:

答案 0 :(得分:1)

webapp_credentials.py位于.gitignore上,这就是为什么迁移无法找到它。

您需要此文件,该文件未在链接的git存储库中进行版本控制。