2016-08-02 2 views
1

heroku 인스턴스에서 nested_inline을 사용하는 django 앱을 배포하려고합니다. 모든 것이 로컬에서 훌륭하게 작동하지만 collectstatic 동안 heroku 서버에서 오류가 발생합니다.heroku에서 nested_inline을 사용할 때 collectstatic 중 장고 오류가 발생했습니다.

나는이어서 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에 추가했습니다.

모든 것이 여전히 문제없이 로컬에서 완벽하게 작동합니다. 그것이 말하는 것처럼

$ 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 

가 표시되지 않습니다 nav-bg.gif 같은 forms-nested.css 파일 참조 이미지, I로까지 어디에서나 존재하는 : 나는 "자식 푸시 Heroku가 마스터"에게 Heroku에 밀어 때, 나는 다음과 같은 오류가 발생합니다 말할 수있다. 하지만 이것은 django와 nested_inline이 로컬에서 완벽하게 잘 동작하는 것을 멈추지 않습니다. 나는 왜 그것이 영웅을 망가뜨릴 지 모르겠다.

답변

1

collectstaticpost-process method으로 인해 발생할 수있는 오류입니다. post-process method disabled와 collectstatic 실행 후

heroku config:set DISABLE_COLLECTSTATIC=1

을 그리고 :

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

를이 다음 오류 그렇지 않은 경우 당신이 할 수있는 일

자동으로 collectstatic 명령을 실행 Heroku가 비활성화입니다 설치 한 nested_inline 앱 일 수 있습니다.

관련 문제