亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么項目無法推送到Heroku?

為什么項目無法推送到Heroku?

楊__羊羊 2019-05-25 18:00:06
按教程將項目推送到heroku,前面步驟一切順利沒有任何錯誤,直到這里出現問題在網上沒有找到解決方法。。。感覺好像是setting.py的設置有問題,但和教程里對照是一樣的:heroku的設置ifos.getcwd()=='/app':importdj_database_urlDATABASES={'default':dj_database_url.config(default='postgres://localhost')}SECURY_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTO','https')ALLOWED_HOSTS=['*']BASE_DIR=os.path.dirname(os.path.abspath(__file__))STATIC_ROOT='staticfiles'STATICFILES_DIRS=(os.path.join(BASE_DIR,'static'),)命令行的報錯:(ll_env)G:python_dorest>herokucreateCreatingapp...done,protected-crag-1803https://protected-crag-1803.h...|https://git.heroku.com/protec...(ll_env)G:python_dorest>gitpushherokumasterCountingobjects:48,done.Deltacompressionusingupto4threads.Compressingobjects:100%(39/39),done.Writingobjects:100%(48/48),11.18KiB|0bytes/s,done.Total48(delta3),reused0(delta0)remote:Compressingsourcefiles...done.remote:Buildingsource:remote:remote:----->Pythonappdetectedremote:----->Installingpython-3.5.2—————————中間內容省略—————————remote:File"/app/.heroku/python/lib/python3.5/site-packages/django/contrib/staticfiles/storage.py",line50,inpathremote:raiseImproperlyConfigured("You'reusingthestaticfilesapp"remote:django.core.exceptions.ImproperlyConfigured:You'reusingthestaticfilesappwithouthavingsettheSTATIC_ROOTsettingtoafilesystempath.remote:remote:!Errorwhilerunning'$pythonmanage.pycollectstatic--noinput'.remote:Seetracebackabovefordetails.remote:remote:Youmayneedtoupdateapplicationcodetoresolvethiserror.remote:Or,youcandisablecollectstaticforthisapplication:remote:remote:$herokuconfig:setDISABLE_COLLECTSTATIC=1remote:remote:https://devcenter.heroku.com/...remote:!Pushrejected,failedtocompilePythonapp.remote:remote:!Pushfailedremote:Verifyingdeploy...remote:remote:!Pushrejectedtoprotected-crag-1803.remote:Tohttps://git.heroku.com/protec...![remoterejected]master->master(pre-receivehookdeclined)error:failedtopushsomerefsto'https://git.heroku.com/protec...'
查看完整描述

2 回答

?
蝴蝶不菲

TA貢獻1810條經驗 獲得超4個贊

Youmayneedtoupdateapplicationcodetoresolvethiserror.remote:Or,youcandisablecollectstaticforthisapplication:remote:remote:$herokuconfig:setDISABLE_COLLECTSTATIC=1
顯示可能是heroku服務器已經有一個靜態文件占位了,所以要刪掉它。執行命令:herokuconfig:setDISABLE_COLLECTSTATIC=0
我也遇到了同樣的問題,用這種方法解決了,希望能幫助你和后來者~
                            
查看完整回答
反對 回復 2019-05-25
  • 2 回答
  • 0 關注
  • 680 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號