我在将Python项目(使用Django)上传到Heroku时遇到问题

时间:2019-10-23 21:02:52

标签: python django heroku

我正在尝试将Python项目部署到Heroku。当我按下Heroku网站上的“部署分支”按钮... https://dashboard.heroku.com/apps/ / deploy / github时,出现此错误。

使用pip安装要求

$ python manage.py collectstatic --noinput

   Traceback (most recent call last):
     File "manage.py", line 21, in <module>
       main()
     File "manage.py", line 17, in main
       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 357, in execute
       django.setup()
     File "/app/.heroku/python/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
       apps.populate(settings.INSTALLED_APPS)
     File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 91, in populate
       app_config = AppConfig.create(entry)
     File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/config.py", line 116, in create
       mod = import_module(mod_path)
     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 941, in _find_and_load_unlocked
     File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
     File "<frozen importlib._bootstrap>", line 994, in _gcd_import
     File "<frozen importlib._bootstrap>", line 971, in _find_and_load
     File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
   ModuleNotFoundError: No module named 'blog'

 Error while running '$ python manage.py collectstatic --noinput'.
   See traceback above for details.
   You may need to update application code to resolve this error.
   Or, you can disable collectstatic for this application:
      $ heroku config:set DISABLE_COLLECTSTATIC=1
   https://devcenter.heroku.com/articles/django-assets
  Push rejected, failed to compile Python app.
  Push failed

0 个答案:

没有答案