2017-11-11 13 views
0

開発したdjangoアプリをGoogleコンソールにデプロイする際に問題があります。 まず、アプリのすべてのファイルの名前をランダムに変更します。また、ウェブサイトの.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] 

おかげで....

+0

エラーがコード内にある場合、要求ログにはスタックトレースが含まれている必要があります。それを見つけて質問に追加してください。アクセスしているビューのビューコードも含めてください。さもなければ、この質問は答えられません。 – snakecharmerb

+2

あなたのポストに情報が足りないため、本当に助けになることはありません。目立つ重要な点の1つは、柔軟な環境からのシンタックスを標準環境と組み合わせていることです( 'entrypoint'は柔軟な環境にのみ適用されます)。 – BrettJ

+0

**初心者の視点から** ...どうすれば私のdjangoのウェブサイトを起動し、Googleのアプリケーションエンジンで動かすことができますか? –

答えて

0

完全な初心者であれば、こちらのGoogleドキュメントに従うことをおすすめします(そのノート取ってステップバイ)ステップ:

  1. Djangoのデフォルトのデータベースがsqlite3のですが、あなたはDjangoアプリケーションを作成するための非常にbegginingでこれを行うことを、あなたは、MySQLにそれを変更する必要がありますし、それが推奨されます。私はこのyoutube video(https://www.youtube.com/watch?v=s16p32pndK0)の指示に従うことをお勧めします
  2. あなたのapp.yamlファイルはそのように見えるはずです。

runtime: python27 
 
api_version: 1 
 
threadsafe: yes 
 

 
handlers: 
 
- url: /static 
 
    static_dir: static/ 
 
    application_readable: True 
 
- url: .* 
 
    script: yourapplication.wsgi.application 
 

 
# Only pure Python libraries can be vendored 
 
# Python libraries that use C extensions can 
 
# only be included if they are part of the App Engine SDK 
 
# Using Third Party Libraries: https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27 
 
libraries: 
 
- name: MySQLdb 
 
    version: 1.2.5 
 
- name: django 
 
    version: "1.11" 
 
- name: ssl 
 
    version: latest 
 
# [END django_app] 
 
    
 
# Google App Engine limits application deployments to 10,000 uploaded files per 
 
# version. The skip_files section allows us to skip virtual environment files 
 
# to meet this requirement. The first 5 are the default regular expressions to 
 
# skip, while the last one is for all env/ files. 
 
skip_files: 
 
- ^(.*/)?#.*#$ 
 
- ^(.*/)?.*~$ 
 
- ^(.*/)?.*\.py[co]$ 
 
- ^(.*/)?.*/RCS/.*$ 
 
- ^(.*/)?\..*$ 
 
- ^env/.*$

私も初心者ですと私は、GAEにすべてのベストを私のアプリを展開するために管理しています。

+0

助けてくれてありがとう助けてくれてありがとうございました git https://github.com/abhisheklokare/Website-using-Python-Django-Frameworkでもプロジェクトをアップロードしました これをチェックしてください... –

関連する問題