This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
- id: build-temp-image | |
name: gcr.io/cloud-builders/docker | |
script: | | |
#!/usr/bin/env bash | |
set -o errexit -o nounset -o pipefail | |
# A custom image with Python + cloud-sql-proxy. We can then use this for | |
# connecting to the database when running django commands. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You need to enable `app_engine_apis: true` to use the built-in memcache | |
# service on App Engine standard. | |
# https://github.com/GoogleCloudPlatform/appengine-python-standard | |
# | |
# Then configure a custom cache backend. | |
# https://docs.djangoproject.com/en/5.1/ref/settings/#backend | |
import logging | |
from django.core.cache.backends.memcached import BaseMemcachedCache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For App Engine. | |
runtime: python311 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup for Ubuntu 20.04 | |
# ====================== | |
# Install Nomad, Consul, Docker | |
# ----------------------------- | |
# GPG keys for Nomad and Docker. | |
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runtime: python38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runtime: python37 | |
handlers: | |
# Redirect / and /my-example-project to /my-example-project/. Requires Python. | |
- url: /(my-example-project)?$ | |
script: auto | |
secure: always | |
# The static assets are collected in a "dist" folder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright David Buxton 2020 | |
# | |
# 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, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/potatolondon/django-gcloud-connectors/blob/b5279492b5b4b615640efa7cc5783a2cee0c1cbe/gcloudc/forms/fields.py#L145 | |
import base64 | |
import itertools | |
_VC_KEY = "1K94KG8L" # Fixed key, don't change this!! | |
def model_path(obj): | |
return obj._meta.db_table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import json | |
# Install google-api-python-client for Py27 | |
import googleapiclient.discovery | |
def publish(data): | |
# The PubSub topic is created beforehand. | |
topic = 'projects/my-app-engine-project/topics/my-topic' |
NewerOlder