【问题标题】:Does heroku support static files now?heroku 现在支持静态文件吗?
【发布时间】:2013-09-09 19:37:52
【问题描述】:

这是一个基本问题。前几天,我在 youtube 上观看了关于将 django 应用程序部署到 heroku 的视频。在那个视频中,他们通过亚马逊网络服务获取静态文件。今天我在 heroku 上部署 django 时,我所有的静态文件都在工作。我在这里遗漏了什么吗?

【问题讨论】:

    标签: django heroku


    【解决方案1】:

    是的,他们现在有一份文件:https://devcenter.heroku.com/articles/django-assets

    【讨论】:

      【解决方案2】:

      将您的 index.html 重命名为 home.html。 使用以下代码创建一个 index.php 文件:

      <?php include_once("home.html"); ?>
      

      现在转到 CMD(或 Bash)中的应用文件夹,然后使用以下命令将代码提交到 Heroku:

      git add .
      git commit -m 'Change this to a meaningful description'
      git push heroku master
      

      Source

      【讨论】:

        猜你喜欢
        • 2017-08-13
        • 1970-01-01
        • 1970-01-01
        • 2023-03-20
        • 2018-04-23
        • 2015-11-06
        • 2013-01-13
        • 2021-12-30
        • 2014-02-04
        相关资源
        最近更新 更多