简体   繁体   English

在 Heroku 上部署 Django?

[英]Deploying Django on Heroku?

I am trying to host a Python\\Django app on Heroku.我正在尝试在 Heroku 上托管 Python\\Django 应用程序。 I followed the guide on heroku website but when I execute the line "heroku ps:scale web:1" it comes back the following message:我遵循了 heroku 网站上的指南,但是当我执行“heroku ps:scale web:1”这一行时,它返回以下消息:

No process types on ⬢ salty-brushlands-45215. ⬢ salty-brushlands-45215 上没有进程类型。
▸ Upload a Procfile to add process types. ▸ 上传 Procfile 以添加流程类型。
https://devcenter.heroku.com/articles/procfile https://devcenter.heroku.com/articles/procfile

I already tryed to commit a Procfile into my project (searching for a solution) but I don't know if requires any configuration inside it.我已经尝试将 Procfile 提交到我的项目中(正在寻找解决方案),但我不知道其中是否需要任何配置。 Help please!请帮忙!

Your Procfile should contain this,你的 Procfile 应该包含这个,

web: gunicorn your_project.wsgi

web defines the type of your application web 定义了应用程序的类型

gunicorn is a wsgi server gunicorn 是一个 wsgi 服务器

1.Create .txt file. 1.创建.txt文件。

2.add this raw to your file: 2.将此原始文件添加到您的文件中:

worker: python main.py

3.save file and delete file extension (.txt) 3.保存文件并删除文件扩展名(.txt)

4.add Procfile to master folder 4.将Procfile添加到主文件夹

5.deploy 5.部署

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM