在尝试部署应用程序时,使用以下命令:heroku run python manage.py migrate错误Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 224, in fetch_command klass = load_command_class(app_name, subcommand) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 36, in load_command_class module = import_module('%s.management.commands.%s' % (app_name, name)) File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed我怀疑这个问题是由我如何部署static. 特别是因为命令:python manage.py collectstatic返回以下错误:FileNotFoundError: [Errno 2] No such file or directory at: '/mnt/project/static/'。虽然,这可能是一个无关的问题。
1 回答
烙印99
TA贡献1829条经验 获得超13个赞
正如@Selcuk 所说,问题是被Pipfile
忽略的requirements.txt
.
从基于requirements.txt
to 的依赖项转换所需的步骤pipenv
是:
$ pip install pipenv
$ pipenv install -r requirements.txt
$ pipenv lock
添加回答
举报
0/150
提交
取消