From 2aab665545122d9c24f75216e755e05e62e2115e Mon Sep 17 00:00:00 2001 From: norman-andrians Date: Sat, 9 Sep 2023 14:48:16 +0700 Subject: [PATCH] moree docs --- README.md | 3 +++ main.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 798367e..2798bd1 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ Leisure project. A REST API that sends a one-time authentication code (a.k.a OTP Setup: - Create a new `.env` file - Add your `EMAIL_SENDER` and `EMAIL_PASSWORD` in your `.env` file +- Optional: + - By default I use gmail for email host, you can configure your `HOST` in the `.env` file. + - You can also add `PORT` in `.env` - Create or use an API test app like Postman Usage: diff --git a/main.py b/main.py index 87ec116..00e810f 100644 --- a/main.py +++ b/main.py @@ -74,7 +74,7 @@ def send_email(): # Everyone has a different email host service # By default we use gmail to test our emails mail_host = os.environ.get("HOST") if os.environ.get("HOST") is not None else "smtp.gmail.com" - mail_port = 465 + mail_port = os.environ.get("PORT") if os.environ.get("PORT") is not None else 465 if mail_sender is None or mail_password is None: return jsonify({