새로운 Django/Wagtail 앱을 Heroku에 배치하려고하는데 문제가 있습니다.Django가 Heroku에 푸시 : "알 수없는 명령 : '압축'합니까?
나는 마지막 섹션 인 "Heroku에서 정적 자산 검색"까지 작동하는 this tutorial을 따르고 있습니다. 내가 git push heroku master
와 Heroku가 앱을 누르면 그러나,이 오류와 함께 실패 : 튜토리얼이 설치를 지정하지 않지만
...
remote: 182 static files copied to '/app/static', 182 post-processed.
remote:
remote: -----> Running run_compress
remote: -----> Compressing static files
remote: Unknown command: 'compress'
remote: Type 'manage.py help' for usage.
remote:
remote: ! Push rejected, failed to compile Python app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to myapp.
remote:
To https://git.heroku.com/myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'
$
은 아마도 Heroku가가, 장고 압축기에 문제가있다, 그래서 나는 확실하지 않다.
#!/usr/bin/env bash
set -eo pipefail
indent() {
RE="s/^/ /"
[ $(uname) == "Darwin" ] && sed -l "$RE" || sed -u "$RE"
}
MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' | head -1)
MANAGE_FILE=${MANAGE_FILE:2}
echo "-----> Compressing static files"
python $MANAGE_FILE compress 2>&1 | indent
echo
그래서 그것이 작동하지 않는
manage.py compress
을 보인다 튜토리얼 대신이처럼 보이는
bash
파일에
run_compress
를 지정
Heroku Django Cookbook라는 것을 설치를 지정합니다. 그렇지 않으면 Whitenoise에서 뭔가있을 수 있습니다. 그 부분은 실패한 튜토리얼 섹션입니다. 그래도 설치가 제대로 된 것 같습니다. 마지막으로
...
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
COMPRESS_OFFLINE = True
COMPRESS_CSS_FILTERS = [
'compressor.filters.css_default.CssAbsoluteFilter',
'compressor.filters.cssmin.CSSMinFilter',
]
COMPRESS_CSS_HASHING_METHOD = 'content'
...
여기 내 requirements.txt
beautifulsoup4==4.4.1
dj-database-url==0.4.1
dj-static==0.0.6
Django==1.9.6
django-appconf==1.0.2
django-compressor==2.0
django-modelcluster==1.1
django-taggit==0.18.3
django-toolbelt==0.0.1
django-treebeard==4.0.1
djangorestframework==3.3.3
gunicorn==19.6.0
html5lib==0.9999999
Pillow==3.2.0
psycopg2==2.6.1
python-dateutil==1.5
pytz==2016.4
rcssmin==1.0.6
requests==2.10.0
rjsmin==1.0.12
six==1.10.0
static3==0.7.0
Unidecode==0.4.19
wagtail==1.4.5
whitenoise==3.2
Willow==0.3.1
어떤 아이디어입니다 : 여기 내 settings.py
에서 관련 라인은 무엇입니까? 모든 리드가 환영합니다. 고맙습니다!
ust this https://djangogirls.gitbooks.io/django-girls-tutorial-extensions/content/heroku/ – shuboy2014
또는 django 프로젝트를 배포하기위한 단계별 비디오를 따라 가십시오. https://www.youtube.com/watch?v=2Mx8JLtNmvw – shuboy2014