Я не могу запустить python manage.py collectstati c? - PullRequest
0 голосов
/ 09 мая 2020

Итак, я пытался исправить свой старый проект, сделанный с использованием Django. Я пытался выполнить развертывание на heroku, и после поиска в Интернете кто-то сказал, что мне нужно запустить команду collectstati c. Но когда я это делаю, это происходит (это после того, как я настроил множество вещей в settings.py):

Found another file with the destination path 'admin/js/vendor/select2/i18n/gl.js'. It will be ignored since only the first encountered file is collected. If this is not what you 
want, make sure every static file has a unique path.
Found another file with the destination path 'admin/js/vendor/select2/i18n/it.js'. It will be ignored since only the first encountered file is collected. If this is not what you 
want, make sure every static file has a unique path.
Post-processing 'admin/css/base.7ea12481fb59.css' failed!

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/base.py", line 328, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "/app/.heroku/python/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 187, in handle
    collected = self.collect()
  File "/app/.heroku/python/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 133, in collect
    raise processed
whitenoise.storage.MissingFileError: The file 'admin/css/fonts.cc6140298ba7.css' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f406a971590>.

The CSS file 'admin/css/base.7ea12481fb59.css' references a file which could not be found:
  admin/css/fonts.cc6140298ba7.css

Please check the URL references in this CSS file, particularly any
relative paths which might be pointing to the wrong location.

Вот как выглядит мой settings.py:

STATIC_URL = '/static/'
STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "staticfiles"),
]
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

Кто-нибудь знает, как это исправить?

...