8000 update region tags (#1631) · lesliepound/python-docs-samples@fe969c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit fe969c3

Browse files
authored
update region tags (GoogleCloudPlatform#1631)
* region tags: request/logging * analytics * analytics standard * quickstart * mailgun, memcache, redis * mailjet, sendgrid * static files * cloud sql and postgresql and datastore * Storage, twilio * pubsub
1 parent 5e78b33 commit fe969c3

File tree

31 files changed

+77
-112
lines changed

31 files changed

+77
-112
lines changed

appengine/flexible/analytics/app.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ entrypoint: gunicorn -b :$PORT main:app
55
runtime_config:
66
python_version: 3
77

8-
#[START env]
8+
#[START gae_flex_analytics_env_variables]
99
env_variables:
1010
GA_TRACKING_ID: your-tracking-id
11-
#[END env]
11+
#[END gae_flex_analytics_env_variables]

appengine/flexible/analytics/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# [START app]
15+
# [START gae_flex_analytics_track_event]
1616
import logging
1717
import os
1818

@@ -71,4 +71,4 @@ def server_error(e):
7171
# This is used when running locally. Gunicorn is used to run the
7272
# application on Google App Engine. See entrypoint in app.yaml.
7373
app.run(host='127.0.0.1', port=8080, debug=True)
74-
# [END app]
74+
# [END gae_flex_analytics_track_event]

appengine/flexible/cloudsql/app.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ entrypoint: gunicorn -b :$PORT main:app
55
runtime_config:
66
python_version: 3
77

8-
#[START env]
8+
#[START gae_flex_mysql_env]
99
env_variables:
1010
# Replace user, password, database, and instance connection name with the values obtained
1111
# when configuring your Cloud SQL instance.
1212
SQLALCHEMY_DATABASE_URI: >-
1313
mysql+pymysql://USER:PASSWORD@/DATABASE?unix_socket=/cloudsql/INSTANCE_CONNECTION_NAME
14-
#[END env]
14+
#[END gae_flex_mysql_env]
1515

16-
#[START cloudsql_settings]
16+
#[START gae_flex_mysql_settings]
1717
# Replace project and instance with the values obtained when configuring your
1818
# Cloud SQL instance.
1919
beta_settings:
2020
cloud_sql_instances: INSTANCE_CONNECTION_NAME
21-
#[END cloudsql_settings]
21+
#[END gae_flex_mysql_settings]

appengine/flexible/cloudsql/create_tables.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
# [START all]
17-
1816
from main import db
1917

2018

2119
if __name__ == '__main__':
2220
print('Creating all database tables...')
2321
db.create_all()
2422
print('Done!')
25-
# [END all]

appengine/flexible/cloudsql/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def is_ipv6(addr):
3434
return False
3535

3636

37-
# [START example]
37+
# [START gae_flex_mysql_app]
3838
# Environment variables are defined in app.yaml.
3939
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['SQLALCHEMY_DATABASE_URI']
4040
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
@@ -79,7 +79,7 @@ def index():
7979
output = 'Last 10 visits:\n{}'.format('\n'.join(results))
8080

8181
return output, 200, {'Content-Type': 'text/plain; charset=utf-8'}
82-
# [END example]
82+
# [END gae_flex_mysql_app]
8383

8484

8585
@app.errorhandler(500)

appengine/flexible/cloudsql_postgresql/app.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ entrypoint: gunicorn -b :$PORT main:app
55
runtime_config:
66
python_version: 3
77

8-
#[START env]
8+
#[START gae_flex_postgres_env]
99
env_variables:
1010
# Replace user, password, database, and instance connection name with the values obtained
1111
# when configuring your Cloud SQL instance.
1212
SQLALCHEMY_DATABASE_URI: >-
1313
postgresql+psycopg2://USER:PASSWORD@/DATABASE?host=/cloudsql/INSTANCE_CONNECTION_NAME
14-
#[END env]
14+
#[END gae_flex_postgres_env]
1515

16-
#[START cloudsql_settings]
16+
#[START gae_flex_postgres_settings]
1717
# Replace project and instance with the values obtained when configuring your
1818
# Cloud SQL instance.
1919
beta_settings:
2020
cloud_sql_instances: INSTANCE_CONNECTION_NAME
21-
#[END cloudsql_settings]
21+
#[END gae_flex_postgres_settings]

appengine/flexible/cloudsql_postgresql/create_tables.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
# [START all]
17-
1816
from main import db
1917

2018

2119
if __name__ == '__main__':
2220
print('Creating all database tables...')
2321
db.create_all()
2422
print('Done!')
25-
# [END all]

appengine/flexible/cloudsql_postgresql/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def is_ipv6(addr):
4141
return False
4242

4343

44-
# [START example]
44+
# [START gae_flex_postgres_app]
4545
# Environment variables are defined in app.yaml.
4646
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['SQLALCHEMY_DATABASE_URI']
4747
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
@@ -86,7 +86,7 @@ def index():
8686
output = 'Last 10 visits:\n{}'.format('\n'.join(results))
8787

8888
return output, 200, {'Content-Type': 'text/plain; charset=utf-8'}
89-
# [END example]
89+
# [END gae_flex_postgres_app]
9090

9191

9292
@app.errorhandler(500)

appengine/flexible/datastore/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def is_ipv6(addr):
3232
return False
3333

3434

35-
# [START example]
35+
# [START gae_flex_datastore_app]
3636
@app.route('/')
3737
def index():
3838
ds = datastore.Client()
@@ -62,7 +62,7 @@ def index():
6262
output = 'Last 10 visits:\n{}'.format('\n'.join(results))
6363

6464
return output, 200, {'Content-Type': 'text/plain; charset=utf-8'}
65-
# [END example]
65+
# [END gae_flex_datastore_app]
6666

6767

6868
@app.errorhandler(500)

appengine/flexible/hello_world/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# [START app]
15+
# [START gae_flex_quickstart]
1616
import logging
1717

1818
from flask import Flask
@@ -40,4 +40,4 @@ def server_error(e):
4040
# This is used when running locally. Gunicorn is used to run the
4141
# application on Google App Engine. See entrypoint in app.yaml.
4242
app.run(host='127.0.0.1', port=8080, debug=True)
43-
# [END app]
43+
# [END gae_flex_quickstart]

0 commit comments

Comments
 (0)
0