我試圖將一個基本的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