-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwsgi.py
More file actions
41 lines (34 loc) · 1.19 KB
/
Copy pathwsgi.py
File metadata and controls
41 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
"""
WSGI Entry Point for Voice Resume Backend
Used by Gunicorn in production
Usage:
gunicorn wsgi:application --config gunicorn.conf.py
"""
import os
import sys
# Ensure the app directory is in the Python path
app_dir = os.path.dirname(os.path.abspath(__file__))
if app_dir not in sys.path:
sys.path.insert(0, app_dir)
# Force UTF-8 encoding
os.environ['PYTHONIOENCODING'] = 'utf-8'
os.environ['LC_ALL'] = 'C.UTF-8'
os.environ['LANG'] = 'C.UTF-8'
# Import the Flask app and SocketIO
from app import app, socketio
# Create WSGI application
# For gevent-websocket worker, we need to expose the app directly
application = app
# For debugging - print startup info
if __name__ != '__main__':
import logging
gunicorn_logger = logging.getLogger('gunicorn.error')
app.logger.handlers = gunicorn_logger.handlers
app.logger.setLevel(gunicorn_logger.level)
app.logger.info("Voice Resume Backend - Starting WSGI application")
# Direct execution for testing
if __name__ == '__main__':
print("Starting development server...")
print("For production, use: gunicorn wsgi:application --config gunicorn.conf.py")
socketio.run(app, debug=True, host='0.0.0.0', port=5000)