简体   繁体   English

Heroku上的Django应用程序,已成功部署但无法提供服务

[英]Django app on Heroku, deployed successfully but could not be served

I have built a simple blog app with Django by following a video and deployed it to Heroku by following another video. 我通过跟踪视频使用Django构建了一个简单的博客应用,并通过跟踪另一个视频将其部署到了Heroku。 The app works fine locally, but it is not working online. 该应用程序在本地可以正常运行,但无法在线运行。 Heroku gives me this error message: Heroku给了我这个错误信息:

This app has no process types yet 该应用还没有进程类型

Add a Procfile to your app in order to define its process types. 将Procfile添加到您的应用中以定义其进程类型。

I had already added a Proclife created with Notepad with these contents: 我已经添加了使用记事本创建的具有以下内容的Proclife:

web: gunicorn mysite.wsgi 网址:gunicorn mysite.wsgi

But how can I add another Procfile to an app already deployed to Heroku? 但是,如何向已部署到Heroku的应用程序中添加另一个Procfile? Where should I place it? 我应该放在哪里?

Yeah that's correct. 是的,没错。 It required file 'Procfile' in the project root directory. 它在项目根目录中需要文件“ Procfile”。 I have created one with below content 我用以下内容创建了一个

web: gunicorn <your-app.wsgi> -b 0.0.0.0:$PORT -w 10

And followed the below link https://devcenter.heroku.com/articles/procfile where everything is mentioned to deploy the code to heroku. 然后点击下面的链接https://devcenter.heroku.com/articles/procfile ,其中提到了将代码部署到heroku的所有内容。 Its been long time for me working with heroku that too with test app so I am not sure if it got changed after that. 对我来说,使用heroku和测试应用程序一起工作也已经很长时间了,所以我不确定在那之后它是否有所改变。 But I think just following the link will work just fine. 但是我认为仅遵循链接就可以了。

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

相关问题 成功部署 Django 到 Heroku 但收到应用程序错误 - Successfully deployed Django to Heroku but received application error Heroku 应用部署成功但应用报错 - Heroku app deployed successfully but Application Error 为什么我的 static 文件在部署到 Heroku 服务器时无法提供服务? (姜戈) - Why are my static files not served when deployed to Heroku server? (Django) 应用程序(Python Django,PostgreSql)已成功部署在Heroku上,但是尝试打开时出现错误 - App (Python Django, PostgreSql) is deployed successfully on Heroku, but I'm getting error when trying to open Heroku 应用程序成功部署,但打开应用程序时收到应用程序错误 - Heroku app successfully deployed, but receiving application error when opening app 我在 Heroku 上成功部署了我的 Web 应用程序,但显示应用程序错误 - I successfully deployed my web app on Heroku but shows Application Error Streamlit Python 应用程序已成功部署到 Heroku,但出现应用程序错误 - Streamlit Python app deployed successfully to Heroku, but I get an application error Django 模型从部署在 Heroku 中的应用程序中消失 - Django Models disappear from app deployed in Heroku 在部署在heroku上的Django应用中运行计划的作业 - running scheduled job in django app deployed on heroku heroku应用程序中未提供静态文件 - static file not served in heroku app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM