➕ 添加.env依赖
This commit is contained in:
1 parent
747c2ebd0a
commit
c1642dbc0c
1 file changed
+5
-5
+5
-5
@@ -4,10 +4,15 @@ from flask import Flask, request, jsonify
|
|||||||
from email.mime.text import MIMEText
|
from email.mime.text import MIMEText
|
||||||
from email import header
|
from email import header
|
||||||
from log_client import logs
|
from log_client import logs
|
||||||
|
from dotenv import load_dotenv
|
||||||
import waitress
|
import waitress
|
||||||
import smtplib
|
import smtplib
|
||||||
import random
|
import random
|
||||||
import time
|
import time
|
||||||
|
import sys, os
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
load_dotenv(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".env"))
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
captchas: dict[str, list[str, str]] = {}
|
captchas: dict[str, list[str, str]] = {}
|
||||||
@@ -22,11 +27,6 @@ def send_email():
|
|||||||
captcha += str(digit)
|
captcha += str(digit)
|
||||||
return captcha
|
return captcha
|
||||||
|
|
||||||
SMTP_SERVER: str = ""
|
|
||||||
SMTP_PORT: str = 0
|
|
||||||
SMTP_USER: str = ""
|
|
||||||
__PASSWORD: str = ""
|
|
||||||
|
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
|
|
||||||
recipient: str = data.get("email")
|
recipient: str = data.get("email")
|
||||||
|
|||||||
Reference in new issue
Block a user