From 98e28f377a1362c673478ff4a11cfabfbe344576 Mon Sep 17 00:00:00 2001 From: Erikka <19295862+erikkai@users.noreply.github.com> Date: Wed, 25 May 2022 12:31:02 -0700 Subject: [PATCH 1/3] Update server.py The app.config line that was here doesn't work anymore in Flask 2.1. References: https://github.com/pallets/flask/issues/4078 https://flask.palletsprojects.com/en/2.1.x/changes/ This change must be added with the config file I'm adding next. --- examples/hosted-oauth/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/hosted-oauth/server.py b/examples/hosted-oauth/server.py index 72caed31..dc7ffe89 100644 --- a/examples/hosted-oauth/server.py +++ b/examples/hosted-oauth/server.py @@ -40,7 +40,7 @@ # For more information, check out the documentation: http://flask.pocoo.org # Create a Flask app, and load the configuration file. app = Flask(__name__) -app.config.from_json("config.json") +app.config.from_pyfile('config.py') # Check for dummy configuration values. # If you are building your own application based on this example, From 856650546f29f70cdf54d9a9b6d8fd87779e8791 Mon Sep 17 00:00:00 2001 From: Erikka <19295862+erikkai@users.noreply.github.com> Date: Wed, 25 May 2022 12:35:34 -0700 Subject: [PATCH 2/3] Update and rename config.json to config.py Changing file to match with the change in the server.py code --- examples/hosted-oauth/config.json | 5 ----- examples/hosted-oauth/config.py | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 examples/hosted-oauth/config.json create mode 100644 examples/hosted-oauth/config.py diff --git a/examples/hosted-oauth/config.json b/examples/hosted-oauth/config.json deleted file mode 100644 index 9b54e3df..00000000 --- a/examples/hosted-oauth/config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "SECRET_KEY": "replace me with a random string", - "NYLAS_OAUTH_CLIENT_ID": "replace me with the client ID from Nylas", - "NYLAS_OAUTH_CLIENT_SECRET": "replace me with the client secret from Nylas" -} diff --git a/examples/hosted-oauth/config.py b/examples/hosted-oauth/config.py new file mode 100644 index 00000000..cb01850b --- /dev/null +++ b/examples/hosted-oauth/config.py @@ -0,0 +1,4 @@ +SECRET_KEY= "replace me with a random string", +NYLAS_OAUTH_CLIENT_ID= "replace me with the client ID from Nylas", +NYLAS_OAUTH_CLIENT_SECRET= "replace me with the client secret from Nylas" + From 8efd67be5e8743299903996f292c19129ab901a9 Mon Sep 17 00:00:00 2001 From: Mostafa Rashed <17770919+mrashed-dev@users.noreply.github.com> Date: Mon, 6 Jun 2022 17:57:55 -0400 Subject: [PATCH 3/3] Applied `black` reformatting --- examples/hosted-oauth/config.py | 7 +++---- examples/hosted-oauth/server.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/hosted-oauth/config.py b/examples/hosted-oauth/config.py index cb01850b..12da98a2 100644 --- a/examples/hosted-oauth/config.py +++ b/examples/hosted-oauth/config.py @@ -1,4 +1,3 @@ -SECRET_KEY= "replace me with a random string", -NYLAS_OAUTH_CLIENT_ID= "replace me with the client ID from Nylas", -NYLAS_OAUTH_CLIENT_SECRET= "replace me with the client secret from Nylas" - +SECRET_KEY = ("replace me with a random string",) +NYLAS_OAUTH_CLIENT_ID = ("replace me with the client ID from Nylas",) +NYLAS_OAUTH_CLIENT_SECRET = "replace me with the client secret from Nylas" diff --git a/examples/hosted-oauth/server.py b/examples/hosted-oauth/server.py index dc7ffe89..cd640531 100644 --- a/examples/hosted-oauth/server.py +++ b/examples/hosted-oauth/server.py @@ -40,7 +40,7 @@ # For more information, check out the documentation: http://flask.pocoo.org # Create a Flask app, and load the configuration file. app = Flask(__name__) -app.config.from_pyfile('config.py') +app.config.from_pyfile("config.py") # Check for dummy configuration values. # If you are building your own application based on this example,