我试图将一个基本的Python博客/网站迁移到Heroku,将其部署到互联网。我部分通过这个过程,并且无法正确获取Procfile。我遵循here for Heroku的说明。Heroku Procfile的正确目录
“Mysite”是我网站的顶级目录。我已经把virtualenv放在它里面,按照instuctions。
我不知道在哪里的Procfile需要去 - 这里是我遇到的错误:
C:\Users\andre\mysite>virtualenv venv
Using base prefix 'c:\\users\\andre\\appdata\\local\\programs\\python\\python35-32'
New python executable in venv\Scripts\python.exe
Installing setuptools, pip, wheel...done.
C:\Users\andre\mysite>venv\Scripts\activate
(venv) C:\Users\andre\mysite>pip freeze > requirements.txt
You are using pip version 7.1.2, however version 8.1.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(venv) C:\Users\andre\mysite>pip install -r requirements.txt
Requirement already satisfied (use --upgrade to upgrade): wheel==0.24.0 in c:\users\andre\mysite\venv\lib\site-packages (from -r requirements.txt (line 1))
You are using pip version 7.1.2, however version 8.1.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(venv) C:\Users\andre\mysite>heroku local web
ERROR: open Procfile: The system cannot find the file specified.
我已经尝试放置Procfile几个不同的地方,但还没有任何运气消除错误。
我使用的Procfile有以下内容:
web: gunicorn mysite.wsgi --log-file -
文件目录如下:
andre/
-Documents/
-Desktop/
-AppData/
-Local/
-heroku/
-mysite/
-blog/
-mysite/
-venv/
-db.sqlite3
-manage.py
-Procfile
-requirements.txt
任何建议我可能是错在这里做什么?谢谢。
谢谢克里斯。我试图在目录中移动Procfile,但这没有帮助 - 导致同样的错误。我已经修改过,以显示我的目录更深入一点,可能会提供更多的信息。基本上,“andre”文件夹是我的电脑的一个通用目录。另外,我已经触及Procfile的“.txt”,但这也没有帮助。 – AME
@AME,看起来你的'Procfile'引用了一个不存在的文件:'mysite.wsgi'。你有WSGI文件吗? – Chris
这是正确的,克里斯,我假设配置/定位WSGI文件将在后来的过程中,虽然我可能会误会。你认为这是问题吗?我认为问题在于Procfile并没有被放置在第一位。我在目录(@ andre/mysite/mysite/wsgi.py)中有一个WSGI.py文件。应该把东西搬到那里?再次感谢。 – AME