Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Copyright 2015 Google Inc.
- #
- # 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.
- """
- This file contains all of the configuration values for the application.
- Update this file with the values for your specific Google Cloud project.
- You can create and manage projects at https://console.developers.google.com
- """
- import os
- # The secret key is used by Flask to encrypt session cookies.
- # [START secret_key]
- SECRET_KEY = 'hourfriend'
- # [END secret_key]
- # There are three different ways to store the data in the application.
- # You can choose 'datastore', 'cloudsql', or 'mongodb'. Be sure to
- # configure the respective settings for the one you choose below.
- # You do not have to configure the other data backends. If unsure, choose
- # 'datastore' as it does not require any additional configuration.
- DATA_BACKEND = 'cloudsql'
- # Google Cloud Project ID. This can be found on the 'Overview' page at
- # https://console.developers.google.com
- PROJECT_ID = 'healthy-life-165611'
- # CloudSQL & SQLAlchemy configuration
- # Replace the following values the respective values of your Cloud SQL
- # instance.
- CLOUDSQL_USER = 'root'
- CLOUDSQL_PASSWORD = ''
- CLOUDSQL_DATABASE = 'mysql'
- # Set this value to the Cloud SQL connection name, e.g.
- # "project:region:cloudsql-instance".
- # You must also update the value in app.yaml.
- CLOUDSQL_CONNECTION_NAME = 'healthy-life-165611:us-east1:hourfriend'
- # The CloudSQL proxy is used locally to connect to the cloudsql instance.
- # To start the proxy, use:
- #
- # $ cloud_sql_proxy -instances=your-connection-name=tcp:3306
- #
- # Port 3306 is the standard MySQL port. If you need to use a different port,
- # change the 3306 to a different port number.
- # Alternatively, you could use a local MySQL instance for testing.
- LOCAL_SQLALCHEMY_DATABASE_URI = (
- 'mysql+pymysql://{user}:{password}@127.0.0.1:3306/{database}').format(
- user=CLOUDSQL_USER, password=CLOUDSQL_PASSWORD,
- database=CLOUDSQL_DATABASE)
- # When running on App Engine a unix socket is used to connect to the cloudsql
- # instance.
- LIVE_SQLALCHEMY_DATABASE_URI = (
- 'mysql+pymysql://{user}:{password}@localhost/{database}'
- '?unix_socket=/cloudsql/{connection_name}').format(
- user=CLOUDSQL_USER, password=CLOUDSQL_PASSWORD,
- database=CLOUDSQL_DATABASE, connection_name=CLOUDSQL_CONNECTION_NAME)
- if os.environ.get('GAE_INSTANCE'):
- SQLALCHEMY_DATABASE_URI = LIVE_SQLALCHEMY_DATABASE_URI
- else:
- SQLALCHEMY_DATABASE_URI = LOCAL_SQLALCHEMY_DATABASE_URI
- # Mongo configuration
- # If using mongolab, the connection URI is available from the mongolab control
- # panel. If self-hosting on compute engine, replace the values below.
- MONGO_URI = 'mongodb://user:password@host:27017/database'
- # Google Cloud Storage and upload settings.
- # Typically, you'll name your bucket the same as your project. To create a
- # bucket:
- #
- # $ gsutil mb gs://<your-bucket-name>
- #
- # You also need to make sure that the default ACL is set to public-read,
- # otherwise users will not be able to see their upload images:
- #
- # $ gsutil defacl set public-read gs://<your-bucket-name>
- #
- # You can adjust the max content length and allow extensions settings to allow
- # larger or more varied file types if desired.
- CLOUD_STORAGE_BUCKET = 'healthy-life-165611.appspot.com'
- MAX_CONTENT_LENGTH = 8 * 1024 * 1024
- ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])
- # OAuth2 configuration.
- # This can be generated from the Google Developers Console at
- # https://console.developers.google.com/project/_/apiui/credential.
- # Note that you will need to add all URLs that your application uses as
- # authorized redirect URIs. For example, typically you would add the following:
- #
- # * http://localhost:8080/oauth2callback
- # * https://<your-app-id>.appspot.com/oauth2callback.
- #
- # If you receive a invalid redirect URI error review you settings to ensure
- # that the current URI is allowed.
- GOOGLE_OAUTH2_CLIENT_ID = \
- 'your-client-id'
- GOOGLE_OAUTH2_CLIENT_SECRET = 'your-client-secret'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement