按教程將項目推送到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...'
為什么項目無法推送到Heroku?
楊__羊羊
2019-05-25 18:00:06