final app for testing and deployment
This commit is contained in:
20
main.py
20
main.py
@@ -1,11 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
QR Code Manager - Main Application Entry Point
|
||||
""" print("🚀 QR Code Manager - Production Mode")
|
||||
print("ℹ️ This should be run with Gunicorn in production!")
|
||||
print("🔧 Use: gunicorn -c gunicorn.conf.py main:app") 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
|
||||
@@ -20,14 +22,20 @@ 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("🚀 Starting QR Code Manager in PRODUCTION mode")
|
||||
print("🔐 Admin user: admin")
|
||||
print("🔒 Make sure to change default credentials!")
|
||||
app.run(host='0.0.0.0', port=5000, debug=False)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user