Python Wagtail-Heroku-在部署期间收集静态和白噪声

Python Wagtail-Heroku-在部署期间收集静态和白噪声,python,django,heroku,wagtail,Python,Django,Heroku,Wagtail,我正在学习来自的新教程 但是我在collectstatic和白噪声包方面遇到了问题 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Python app detected remote: -----> Installing requirements with pip remote: remote: -----> $ python manage.

我正在学习来自的新教程

但是我在
collectstatic
和白噪声包方面遇到了问题

remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing requirements with pip
remote: 
remote: -----> $ python manage.py collectstatic --noinput
remote:        Traceback (most recent call last):
remote:          File "manage.py", line 10, in <module>
remote:            execute_from_command_line(sys.argv)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
remote:            utility.execute()
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
remote:            self.fetch_command(subcommand).run_from_argv(self.argv)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
remote:            self.execute(*args, **cmd_options)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
remote:            output = self.handle(*args, **options)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 189, in handle
remote:            collected = self.collect()
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 105, in collect
remote:            for path, storage in finder.list(self.ignore_patterns):
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/finders.py", line 125, in list
remote:            for path in utils.get_files(storage, ignore_patterns):
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/utils.py", line 28, in get_files
remote:            directories, files = storage.listdir(location)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/core/files/storage.py", line 313, in listdir
remote:            for entry in os.listdir(path):
remote:        FileNotFoundError: [Errno 2] No such file or directory: '/tmp/build_4d889a5985b9c262c637b03bd07e9098/hello/static'
remote: 
remote:  !     Error while running '$ python manage.py collectstatic --noinput'.
remote:        See traceback above for details.
remote: 
remote:        You may need to update application code to resolve this error.
remote:        Or, you can disable collectstatic for this application:
remote: 
remote:           $ heroku config:set DISABLE_COLLECTSTATIC=1
remote: 
remote:        https://devcenter.heroku.com/articles/django-assets
base.py:

from .base import *

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '%342u%f#56t6!iw4t+4st8$5j%8d51-7=tf#3#zk2=b&g%jnw^'

# SECURITY WARNING: define the correct hosts in production!
ALLOWED_HOSTS = ['*'] 

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'


try:
    from .local import *
except ImportError:
    pass

安装以前版本的whitenoise
pip install whitenoise==3.3.1
并按照教程进行操作,直到与
内部服务器错误相同为止抱歉,似乎有错误。请稍后再试。
安装white noire 3.3.1、pip freeze、git add,承诺并保持不变。我仍然有
禁用\u COLLECTSTATIC
是我的heroku设置。你有什么想法吗?这个问题用
production.py
wsgi.py
文件更新了
/tmp/build_4d889a5985b9c262c637b03bd07e9098/hello/static
来修复本地运行的
python manage.py collectstatic
,并在设置文件集
DEBUG=False
中检查错误的位置出现一个问题:在本地执行
collectstatic
python从
Copying'/Users/charles/test/hello/hello/static/js/hello.js'
中获取静态信息,但是这个命令也从my env中的
/Users/charles/test/lib/
获取静态信息。但是我的git存储库(gitinit)是在
hello/hello/static/js/hello.js
上创建的。你认为heroku过程中的问题来自这里吗?
from .base import *

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '%342u%f#56t6!iw4t+4st8$5j%8d51-7=tf#3#zk2=b&g%jnw^'

# SECURITY WARNING: define the correct hosts in production!
ALLOWED_HOSTS = ['*'] 

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'


try:
    from .local import *
except ImportError:
    pass