Я пытаюсь развернуть сайт / веб-приложение, используя django ... созданный app.yaml и needs.txt ... все сделано, и когда я нажимаю gcloud app deploy
, у меня появляется следующий журнал ошибок в конце ..
DONE
-----------------------------------------------------------------------------------------------------------------------------------------
Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
[2019-03-18 03:14:29 +0000] [1] [INFO] Starting gunicorn 19.9.0
[2019-03-18 03:14:29 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2019-03-18 03:14:29 +0000] [1] [INFO] Using worker: sync
[2019-03-18 03:14:29 +0000] [9] [INFO] Booting worker with pid: 9
[2019-03-18 03:14:29 +0000] [9] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
self.load_wsgi()
File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
self.wsgi = self.app.wsgi()
File "/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
return self.load_wsgiapp()
File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
return util.import_app(self.app_uri)
File "/env/local/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
__import__(module)
ImportError: Import by filename is not supported.
[2019-03-18 03:14:29 +0000] [9] [INFO] Worker exiting (pid: 9)
[2019-03-18 03:14:29 +0000] [1] [INFO] Shutting down: Master
[2019-03-18 03:14:29 +0000] [1] [INFO] Reason: Worker failed to boot.
вот мой app.yaml
runtime: python
api_version: 1
threadsafe: true
# the PROJECT-DIRECTORY is the one with settings.py and wsgi.py
entrypoint: gunicorn -b :$PORT ~/NovUs/rec/rec.wsgi
# specific to a GUnicorn HTTP server deployment
env: flex
# for Google Cloud Flexible App Engine
# any environment variables you want to pass to your application.
# accessible through os.environ['VARIABLE_NAME']
env_variables:
# the secret key used for the Django app (from PROJECT-DIRECTORY/settings.py)
SECRET_KEY: '***i removed this***'
DEBUG: 'False' # always False for deployment
# everything after /cloudsql/ can be found by entering >> gcloud sql instances describe DATABASE-NAME << in your Terminal
# the DATABASE-NAME is the name you gave your project's PostgreSQL database
# the second line from the describe output called connectionName can be copied and pasted after /cloudsql/
DB_HOST: '/cloudsql/ final-234816:us-central1:novusdb'
DB_PORT: '5432' # PostgreSQL port
DB_NAME: 'novusdb'
DB_USER: 'postgres' # either 'postgres' (default) or one you created on the PostgreSQL instance page
DB_PASSWORD: ''
STATIC_URL: 'https://storage.googleapis.com/BUCKET-NAME/static/' # this is the url that you sync static files to
handlers:
- url: /static
static_dir: static
- url: /
script: home.app
- url: /index\.html
script: home.app
- url: /stylesheets
static_dir: stylesheets
- url: /(.*\.(gif|png|jpg))$
static_files: static/\1
upload: static/.*\.(gif|png|jpg)$
- url: /admin/.*
script: admin.app
login: admin
- url: /.*
script: not_found.app
beta_settings:
# from command >> gcloud sql instances describe DATABASE-NAME <<
cloud_sql_instances: final-234816:us-central1:novusdb
#runtime_config:
#python_version: 2 # enter your Python version BASE ONLY here. Enter 2 for 2.7.9 or 3 for 3.6.4
#manual_scaling:
# instances: 1
#resources:
# cpu: 1
# memory_gb: 0.5
# disk_size_gb: 10
здесь, в моем settings.py WSGI_APPLICATION = 'rec.wsgi.application'
, даже если я изменю его на WSGI_APPLICATION = 'wsgi.application'
, это не решит, ошибка остается той же.
и я попытался отредактировать точку входа с помощью main:app
проблема та же .... кто-то, пожалуйста, решите это.большое спасибо