2016-08-02 1 views
1

herokuインスタンスでnested_inlineを使用するdjangoアプリケーションをデプロイしようとしています。ローカルはすごくうまくいっていますが、私はcollectstaticの間にherokuサーバーにエラーが発生しています。herokuでnested_inlineを使用しているときにcollectstaticでDjangoエラーが発生する

the heroku guide to getting a minimal django setup workingに続いた。次に、requirements.txtに「django-nested-inline」を追加し、INSTALLED_APPSの最後に「nested_inline」を追加し、「nested_inline.admin import NestedModelAdmin、NestedStackedInline」をadmin.pyに追加しました。

すべてが問題なくローカルで完全に動作します。それが言うようにforms-nested.cssファイル参照のどこ限り私としては存在していないようでnav-bg.gifのような画像は、

$ git push heroku master 
Counting objects: 7, done. 
Delta compression using up to 8 threads. 
Compressing objects: 100% (7/7), done. 
Writing objects: 100% (7/7), 670 bytes | 0 bytes/s, done. 
Total 7 (delta 5), reused 0 (delta 0) 
remote: Compressing source files... done. 
remote: Building source: 
remote: 
remote: -----> Python app detected 
remote: $ pip install -r requirements.txt 
remote: Collecting django-nested-inline (from -r requirements.txt (line 6)) 
remote: Downloading django-nested-inline-0.3.6.tar.gz 
remote: Installing collected packages: django-nested-inline 
remote: Running setup.py install for django-nested-inline: started 
remote: Running setup.py install for django-nested-inline: finished with status 'done' 
remote: Successfully installed django-nested-inline-0.3.6 
remote: 
remote: $ python manage.py collectstatic --noinput 
remote: Post-processing 'admin/css/forms-nested.css' failed! 
remote: Traceback (most recent call last): 
remote: File "manage.py", line 10, in 
remote: execute_from_command_line(sys.argv) 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/init.py", line 353, in execute_from_command_line 
remote: utility.execute() 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/init.py", line 345, in execute 
remote: self.fetch_command(subcommand).run_from_argv(self.argv) 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv 
remote: self.execute(args, *cmd_options) 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute 
remote: output = self.handle(args, *options) 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 176, in handle 
remote: collected = self.collect() 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 128, in collect 
remote: raise processed 
remote: whitenoise.django.MissingFileError: The file 'admin/img/nav-bg.gif' could not be found with . 
remote: The CSS file 'admin/css/forms-nested.css' references a file which could not be found: 
remote: admin/img/nav-bg.gif 
remote: Please check the URL references in this CSS file, particularly any 
remote: relative paths which might be pointing to the wrong location. 
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 

:私はHerokuの「GitのプッシュHerokuのマスター」にプッシュする場合でも、私は次のエラーを取得します伝えることができます。しかし、これはdjangoとnested_inlineがローカルで完全に正常に動作するのを止めるものではありません。なぜそれが英雄を壊しているのか分かりません。

答えて

1

これはcollectstaticpost-process methodのために発生する可能性があるエラーです。

heroku config:set DISABLE_COLLECTSTATIC=1

をそしてpost-process method disabledでcollectstatic実行します:あなたは何ができるか

は自動的にcollectstaticコマンドを実行するために、Herokuのを無効にしている

heroku run python manage.py collectstatic --no-post-process --noinput 

これは、エラーでない場合あなたがインストールしたnested_inlineアプリかもしれません。

関連する問題