我在Google控制檯上部署開發的django應用程序時遇到問題。 首先,它將應用程序的所有文件重命名爲一些隨機名稱。另外,當我嘗試訪問網站.appspot.com時,出現內部錯誤。我們如何在google雲上部署django應用?
已創建app.yaml文件:
# [START runtime]
runtime: python27
entrypoint: gunicorn -b :$PORT mysite.wsgi
threadsafe: true
# [END runtime]
handlers:
- url: /static
static_dir: website/static
- url: /.*
script: main.application
libraries:
- name: django
version: 1.11
也創造了appengine_cofig.py文件:
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# [START vendor]
from google.appengine.ext import vendor
vendor.add('lib')
# [END vendor]
感謝提前的幫助....
如果錯誤出現在您的代碼中,那麼請求日誌應該包含堆棧跟蹤。請找到它並將其添加到您的問題;請包括您正在訪問的視圖的視圖代碼。否則這個問題是無法回答的。 – snakecharmerb
沒有足夠的信息在您的文章真正能夠幫助你很多。突出的一點是,您將靈活環境的語法與標準環境相結合(「入口點」僅適用於靈活環境)。 – BrettJ
**從初學者的角度來看** ...我怎樣才能讓我的django網站上運行谷歌應用程序引擎? –