Production deployment fixes and enhancements
- Added environment variable loading with python-dotenv - Fixed Docker session permissions by using /tmp directory - Updated .dockerignore to include .env file properly - Enhanced docker-compose.yml with env_file directive - Fixed Gunicorn configuration for Docker compatibility - Updated README.md with comprehensive deployment docs - Cleaned up debug logging from API routes - Added DOMAIN_SETUP.md for reverse proxy guidance - All production issues resolved and tested working - Application now accessible at qr.moto-adv.com
This commit is contained in:
6
app/__init__.py
Normal file → Executable file
6
app/__init__.py
Normal file → Executable file
@@ -4,11 +4,15 @@ A modern Flask web application for generating and managing QR codes with authent
|
||||
"""
|
||||
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
from flask import Flask
|
||||
from flask_cors import CORS
|
||||
from flask_session import Session
|
||||
from app.utils.auth import init_admin
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
||||
def create_app():
|
||||
"""Create and configure the Flask application"""
|
||||
app = Flask(__name__)
|
||||
@@ -18,6 +22,8 @@ def create_app():
|
||||
app.config['SESSION_TYPE'] = 'filesystem'
|
||||
app.config['SESSION_PERMANENT'] = False
|
||||
app.config['SESSION_USE_SIGNER'] = True
|
||||
app.config['SESSION_FILE_DIR'] = '/tmp/flask_session' # Use /tmp for sessions
|
||||
app.config['SESSION_FILE_THRESHOLD'] = 500
|
||||
|
||||
# Initialize CORS
|
||||
CORS(app)
|
||||
|
||||
0
app/routes/__init__.py
Normal file → Executable file
0
app/routes/__init__.py
Normal file → Executable file
0
app/routes/api.py
Normal file → Executable file
0
app/routes/api.py
Normal file → Executable file
0
app/routes/auth.py
Normal file → Executable file
0
app/routes/auth.py
Normal file → Executable file
0
app/routes/main.py
Normal file → Executable file
0
app/routes/main.py
Normal file → Executable file
0
app/templates/edit_links.html
Normal file → Executable file
0
app/templates/edit_links.html
Normal file → Executable file
0
app/templates/index.html
Normal file → Executable file
0
app/templates/index.html
Normal file → Executable file
0
app/templates/link_page.html
Normal file → Executable file
0
app/templates/link_page.html
Normal file → Executable file
0
app/templates/login.html
Normal file → Executable file
0
app/templates/login.html
Normal file → Executable file
0
app/utils/__init__.py
Normal file → Executable file
0
app/utils/__init__.py
Normal file → Executable file
0
app/utils/auth.py
Normal file → Executable file
0
app/utils/auth.py
Normal file → Executable file
0
app/utils/data_manager.py
Normal file → Executable file
0
app/utils/data_manager.py
Normal file → Executable file
0
app/utils/link_manager.py
Normal file → Executable file
0
app/utils/link_manager.py
Normal file → Executable file
0
app/utils/qr_generator.py
Normal file → Executable file
0
app/utils/qr_generator.py
Normal file → Executable file
0
app/utils/url_shortener.py
Normal file → Executable file
0
app/utils/url_shortener.py
Normal file → Executable file
Reference in New Issue
Block a user