· 5 years ago · Aug 12, 2020, 12:02 PM
1runtime: python
2
3# the PROJECT-DIRECTORY is the one with settings.py and wsgi.py
4entrypoint: gunicorn -b :$PORT PROJECT-DIRECTORY.wsgi # specific to a GUnicorn HTTP server deployment
5env: flex # for Google Cloud Flexible App Engine
6
7# any environment variables you want to pass to your application.
8# accessible through os.environ['VARIABLE_NAME']
9env_variables:
10# the secret key used for the Django app (from PROJECT-DIRECTORY/settings.py)
11 SECRET_KEY: 'DJANGO-SECRET-KEY'
12 DEBUG: 'False' # always False for deployment
13
14# everything after /cloudsql/ can be found by entering >> gcloud sql instances describe DATABASE-NAME << in your Terminal
15# the DATABASE-NAME is the name you gave your project's PostgreSQL database
16# the second line from the describe output called connectionName can be copied and pasted after /cloudsql/
17 DB_HOST: '/cloudsql/PROJECT-ID:COMPUTE-ENGINE-ZONE:DATABASE-NAME'
18 DB_PORT: '5432' # PostgreSQL port
19 DB_NAME: 'DATABASE-NAME'
20 DB_USER: 'DATABASE-USERNAME' # either 'postgres' (default) or one you created on the PostgreSQL instance page
21 DB_PASSWORD: 'DATABASE-PASSWORD'
22
23 STATIC_URL: 'https://storage.googleapis.com/BUCKET-NAME/static/' # this is the url that you sync static files to
24
25handlers:
26- url: /static
27 static_dir: static
28
29beta_settings:
30# from command >> gcloud sql instances describe DATABASE-NAME <<
31 cloud_sql_instances: PROJECT-ID:COMPUTE-ENGINE-ZONE:DATABASE-NAME
32
33runtime_config:
34 python_version: 3 # enter your Python version BASE ONLY here. Enter 2 for 2.7.9 or 3 for 3.6.4