# Config

```python
import os
import json


class Config:
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess secret'
    # Specific name for flask-sqlalchemy
    SQLALCHEMY_DATABASE_URI = json.load(open('zappa_settings.json'))[
        'production']['environment_variables']['DATABASE_URL']
    JWT_SECRET_KEY = 'your-secret-key'
    # Needed to validate tokens
    GOOGLE_CLIENT_ID = '1092564513780-fffffffffffffffffffff.apps.googleusercontent.com'

    @staticmethod
    def init_app(app):
        pass


class DevelopmentConfig(Config):
    # Should still set --debug flag when running flask run
    DEBUG = True
    AWS_PROFILE_NAME = 'diced'


class ProductionConfig(Config):
    AWS_PROFILE_NAME = 'default'


config = {
    'development': DevelopmentConfig,
    'default': DevelopmentConfig,
    'production': ProductionConfig,
}

```

```python
from flask import request, current_app, make_response

#Use current_app to access config
@bp.route("/google_login", methods=["POST"])
def google_login():
    if not request.is_json:
        return make_response("Missing JSON in request", 400)
    token = request.json.get('token', None)
    try:
        idinfo = id_token.verify_oauth2_token(
            token, requests.Request(), current_app.config['GOOGLE_CLIENT_ID'])

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://openai.gitbook.io/code-cheatsheets/all/python/flask/config.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
