2017-11-11 6 views
0

Google 콘솔에 개발 된 django 앱을 배포하는 데 문제가 있습니다. 먼저 앱의 모든 파일의 이름을 임의의 이름으로 바꿉니다. 또한 웹 사이트 .appspot.com을 클릭하면 내부 오류가 발생합니다.Google 클라우드에서 장고 앱을 어떻게 배포 할 수 있습니까?

는 애플리케이션 제목 파일을 만든 :

# [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

게시물에 정보가 충분하지 않아 실제로 도움이 될 수 없습니다. 눈에 띄는 한 가지는 유연한 환경의 구문을 표준 환경과 결합하는 것입니다 ('진입 점'은 유연한 환경에만 적용됨). – BrettJ

+0

** 초보자 용 관점 ** ... 어떻게 내 장고 웹 사이트를 만들어서 Google 앱 엔진에서 실행할 수 있습니까 ??? –

답변

0

완전한 초보자로서 여기에서 Google 문서 ()를 따르는 것이 좋습니다. 참고 복용 단계로) 단계 :

  1. 장고의 기본 데이터베이스가 sqlite3를입니다, 당신은 당신의 장고 응용 프로그램을 만드는 매우 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

도움을 주셔서 감사합니다. 이미 GAE에 내 앱을 배포했습니다. 프로젝트를 git https://github.com/abhisheklokare/Website-using-Python-Django-Framework에 업로드했습니다. 확인해주세요. –