Files
qr-code_manager/main.py
ske087 264a81652a 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
2025-07-16 17:49:10 -04:00

45 lines
1.6 KiB
Python
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
"""
QR Code Manager - Main Application Entry Point
A modern Flask web application for generating and managing QR codes with authentication.
Features include:
- Multiple QR code types (text, URL, WiFi, email, SMS, vCard)
- Dynamic link pages for managing collections of links
- URL shortener functionality with custom domains
- Admin authentication with bcrypt password hashing
- Docker deployment ready
- Modern responsive web interface
"""
import os
from dotenv import load_dotenv
from app import create_app
# Load environment variables from .env file
load_dotenv()
# Create Flask application
app = create_app()
if __name__ == '__main__':
# Production vs Development configuration
is_production = os.environ.get('FLASK_ENV') == 'production'
app_domain = os.environ.get('APP_DOMAIN', 'localhost:5000')
if is_production:
print("🚀 QR Code Manager - Production Mode")
print(" This should be run with Gunicorn in production!")
print("<EFBFBD> Use: gunicorn -c gunicorn.conf.py main:app")
print(f"🌐 Domain configured: {app_domain}")
print("🔗 URL shortener available at: /s/")
# In production, this file is used by Gunicorn as WSGI application
# The Flask dev server should NOT be started in production
else:
print("🛠️ Starting QR Code Manager in DEVELOPMENT mode")
print("🔐 Admin user: admin")
print("🔑 Default password: admin123")
print(f"🌐 Domain configured: {app_domain}")
print("🔗 URL shortener available at: /s/")
app.run(host='0.0.0.0', port=5000, debug=True)