启动一个应用程序在heroku?什么是procfile? 'web:'命令? [英] Launching an app in heroku? What is procfile? 'web:' command?

查看:894
本文介绍了启动一个应用程序在heroku?什么是procfile? 'web:'命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我指的是这个网站,因为我正在学习python / flask并试图使用heroku。



http://ryaneshea.com/lightweight-python-apps-with-flask-twitter-bootstrap-and-heroku



让我解释一下我所做的只有一个像我一样卡住的人可以得到照片。
我正在使用Linux Backtrack命令行。
1.我启动了virtualenv,然后安装了flask
virtualenv --distribute
pip install flask 然后,连接好heroku和github,也在github中创建了一个回购。
写了一个简单的脚本并保存在app.py中

然后,要求创建一个procfile!
web:python app.py

问题。
1.通俗文件中的procfile是什么?
2.当我输入web:python app.py时,它显示'web :: command not found'



请详细说明这是如何工作的?



我还有一个疑问,sudo是至高无上的用户权利?
我们不应该在virtualenv中使用它?
为什么我们使用virtualenv?一个简单的例子。

问题是非常基本的。解决方案Procfile告诉Heroku应该运行哪些命令(

) .com / articles / procfile> https://devcenter.heroku.com/articles/procfile )。



您可以定义不同的流程类型,比如web(默认情况下自动启动的唯一一个),工作人员等等。

因此基本上是一个包含
$的Procfile b $ b

  web:python app.py 

告诉Heroku开始一个名为web的命名进程,并在启动时运行 python app.py



Heroku的Python特定文档位于 https:// devcenter。 heroku.com/articles/getting-started-with-python#declare-process-types-with-procfile


I was referring to this site as i am learning python/flask and trying to use heroku.

http://ryaneshea.com/lightweight-python-apps-with-flask-twitter-bootstrap-and-heroku

Let me explain what all I did, so that any one who is stuck like me can get the picture. I am using Linux Backtrack command line . 1. I started virtualenv and then installed flask virtualenv --distribute pip install flask

Then, connected heroku and github, created a repo also in the github. Wrote a simple script and saved it in app.py

Then, asked to create a procfile! web: python app.py

Questions. 1. What is procfile in layman terms? 2. When i type web: python app.py, it says 'web:: command not found'

Please elaborate how this works?

I have one more doubt, sudo is supreme user right? We are not supposed to use it in virtualenv? And for what exactly are we using virtualenv? A simple example.

Questions are pretty basic. DO bare.

解决方案

the Procfile tells Heroku what commands should be run (https://devcenter.heroku.com/articles/procfile).

You are able to define difference process types, such as web (the only one which will autostart by default), workers, etc...

So basically a Procfile containing

web: python app.py

is telling Heroku to started a named process called web, and to run python app.py when it starts.

There is Python specific documentation for Heroku at https://devcenter.heroku.com/articles/getting-started-with-python#declare-process-types-with-procfile

这篇关于启动一个应用程序在heroku?什么是procfile? 'web:'命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆