简体   繁体   English

当我尝试将我的 Django 项目部署到 Heroku 时,它没有检测到 buildpack。 有人可以帮我吗?

[英]When I tried to deploy to Heroku my Django project it is not detecting the buildpack. Could anyone help me please?

I have tried all methods in the documentation but still I am having the same issue.我已经尝试了文档中的所有方法,但我仍然遇到同样的问题。

我用几种方法将它推到 Heroku 但我仍然有同样的问题

No default language could be detected for this app.

You need to specify a buildpack.您需要指定一个构建包。 It can't pick a default language because you are either missing files (eg requirements.txt ) or you have too many like Aptfile , Gemfile , package,json , etc.它无法选择默认语言,因为您要么缺少文件(例如requirements.txt,要么有太多文件,例如AptfileGemfilepackage,json等。
So if you have requirements.txt and package.json it does not know if your project uses python or node or even both.因此,如果您有requirements.txtpackage.json它不知道您的项目是否使用 python 或节点,甚至两者。

Here I am using multiple buildpacks: https://i.imgur.com/LNHZAKe.png这里我使用了多个构建包: https://i.imgur.com/LNHZAKe.png

Add the buildpacks either through CLI or through the dashboard .通过CLI仪表板添加构建包。

did you make necessary changes in your settings.py,created Procfile, and all requirmenets packages in requirements.txt by您是否对您的 settings.py、创建的 Procfile 以及 requirements.txt 中的所有要求包进行了必要的更改?

pip freeze > requirements.txt

if not please check this link heroku django configure如果不是,请检查此链接heroku django 配置

please share your settings.py file by copying code not as screenshot what i can see it says no default language detected make sure that there is default language in your settings.py in language code请通过复制代码而不是屏幕截图来共享您的 settings.py 文件 我可以看到它说没有检测到默认语言 确保您的 settings.py 语言代码中有默认语言

  1. You need to add a Procfile at the root of your project with content such as您需要在项目的根目录中添加一个Procfile ,其中包含以下内容

    web: gunicorn yourproject.wsgi --log-file--
  2. You also need to specify the runtime python version to use.您还需要指定要使用的运行时 python 版本。

    You do that by creating runtime.txt at the root your project with content python-3.7.9为此,您可以在项目的根目录中使用内容python-3.7.9创建runtime.txt

  3. If you didn't create one before, we need to create a requirements.txt file to tell Heroku what Python packages need to be installed on our server.如果您之前没有创建过,我们需要创建一个requirements.txt文件来告诉 Heroku 哪些 Python 包需要安装在我们的服务器上。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 student() 没有 arguments 错误。 我试图检查一切都可以请任何人帮助我解决它 - student() takes no arguments error. I tried to check everything can anyone please help me in solving it ModuleNotFoundError:当我尝试在 heroku 上部署我的 django 项目时,没有名为“fcntl”的模块 - ModuleNotFoundError: No module named 'fcntl' when I try to deploy my django project on heroku 我下面的代码工作正常并在 python 中打印......但是当我尝试发布它时,它给出了这些错误。 你能帮我解决这个问题吗? - My code below is working correctly and printing in python…However when I try to tweet it, it gives these errors. Could you please help me with this? 无法在 heroku 上部署我的 django 项目 - Failed to deploy my django project on heroku 当我将Django应用程序部署到heroku时,站点停止工作 - When i deploy my django app to heroku the site stops working 有人可以帮我处理我的 Python 代码吗? - Could someone please help me with my Python code? 请问有人可以帮我整理我的代码吗? - Please could someone help me to tidy up my code? 您好,当我在 Jupyter 笔记本中执行此查询时,它会显示错误。 请帮帮我 - Hello When I execute this query in my Jupyter notebook it shows me error. Please help me out 当我将我的 django 项目放在 Heroku 上时出现错误:错误:由于 OSError:[Errno 2],无法安装软件包 - I have an error when i put my django project on Heroku: ERROR: Could not install packages due to an OSError: [Errno 2] 我尝试打开一个 python 文件并得到了这个,请任何人帮忙 - i tried opening a python file and got this, please can anyone help out
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM