refactor: Remove hardcoded email and improve environment variable handling
- Removed hardcoded email address `hello@ciphervance.com` and replaced it with `SENDER_EMAIL` from environment variables. - Added `python-dotenv` to load environment variables from `.env` file for better configuration management. - Removed redundant logging setup and debug statements for cleaner code. - Simplified the `send_email` function by removing unnecessary logging and debug output. - Ensured consistent use of environment variables for SMTP settings and recipient email. This change improves maintainability and security by avoiding hardcoded values and centralizing configuration.
This commit is contained in:
parent
338a24ad4b
commit
15628dc4f3
2 changed files with 8 additions and 23 deletions
|
|
@ -2,13 +2,12 @@ from flask import Flask
|
|||
from dotenv import load_dotenv
|
||||
import os
|
||||
|
||||
load_dotenv() # Load environment variables from .env file
|
||||
load_dotenv()
|
||||
|
||||
def create_app():
|
||||
app = Flask(__name__)
|
||||
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY')
|
||||
|
||||
# Register blueprints or routes here
|
||||
from .routes import main
|
||||
app.register_blueprint(main)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue