feat: Major system improvements and production deployment

 New Features:
- Added view_orders route with proper table display
- Implemented CSV upload with preview workflow and date parsing
- Added production WSGI server configuration with Gunicorn
- Created comprehensive production management scripts

🔧 Bug Fixes:
- Fixed upload_data route column mapping for actual CSV structure
- Resolved print module database queries and template rendering
- Fixed view orders navigation routing (was pointing to JSON API)
- Corrected barcode display width constraints in print module
- Added proper date format parsing for MySQL compatibility

🎨 UI/UX Improvements:
- Updated view_orders template with theme-compliant styling
- Hidden barcode text in print module preview for cleaner display
- Enhanced CSV upload with two-step preview-then-save workflow
- Improved error handling and debugging throughout upload process

🚀 Production Infrastructure:
- Added Gunicorn WSGI server with proper configuration
- Created systemd service for production deployment
- Implemented production management scripts (start/stop/status)
- Added comprehensive logging setup
- Updated requirements.txt with production dependencies

📊 Database & Data:
- Enhanced order_for_labels table compatibility
- Fixed column mappings for real CSV data structure
- Added proper date parsing and validation
- Improved error handling with detailed debugging

🔧 Technical Debt:
- Reorganized database setup documentation
- Added proper error handling throughout upload workflow
- Enhanced debugging capabilities for troubleshooting
- Improved code organization and documentation
This commit is contained in:
Quality System Admin
2025-10-11 23:31:32 +03:00
parent af62fa478f
commit d264bcdca9
20 changed files with 1295 additions and 193 deletions

59
logs/access.log Normal file
View File

@@ -0,0 +1,59 @@
127.0.0.1 - - [11/Oct/2025:21:54:27 +0300] "GET / HTTP/1.1" 200 1189 "-" "Wget/1.25.0" 52198
192.168.0.114 - - [11/Oct/2025:21:54:45 +0300] "GET /settings HTTP/1.1" 200 7526 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 52041
192.168.0.114 - - [11/Oct/2025:21:54:45 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 13844
192.168.0.114 - - [11/Oct/2025:21:54:45 +0300] "GET /static/style.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 28824
192.168.0.114 - - [11/Oct/2025:21:54:45 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 28843
192.168.0.114 - - [11/Oct/2025:21:54:45 +0300] "GET /static/script.js HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 28905
192.168.0.114 - - [11/Oct/2025:21:55:15 +0300] "POST /create_user HTTP/1.1" 302 205 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 14915
192.168.0.114 - - [11/Oct/2025:21:55:15 +0300] "GET /settings HTTP/1.1" 200 8101 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 57417
192.168.0.114 - - [11/Oct/2025:21:55:15 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2648
192.168.0.114 - - [11/Oct/2025:21:55:15 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 3406
192.168.0.114 - - [11/Oct/2025:21:55:15 +0300] "GET /static/script.js HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 29402
192.168.0.114 - - [11/Oct/2025:21:55:15 +0300] "GET /static/style.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 29573
192.168.0.114 - - [11/Oct/2025:21:55:51 +0300] "POST /create_user HTTP/1.1" 302 205 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 15335
192.168.0.114 - - [11/Oct/2025:21:55:51 +0300] "GET /settings HTTP/1.1" 200 8603 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 74762
192.168.0.114 - - [11/Oct/2025:21:55:51 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2530
192.168.0.114 - - [11/Oct/2025:21:55:51 +0300] "GET /static/script.js HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2964
192.168.0.114 - - [11/Oct/2025:21:55:51 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 14047
192.168.0.114 - - [11/Oct/2025:21:55:51 +0300] "GET /static/style.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 28996
192.168.0.114 - - [11/Oct/2025:21:56:09 +0300] "POST /create_user HTTP/1.1" 302 205 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 15124
192.168.0.114 - - [11/Oct/2025:21:56:09 +0300] "GET /settings HTTP/1.1" 200 9105 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 57317
192.168.0.114 - - [11/Oct/2025:21:56:09 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2372
192.168.0.114 - - [11/Oct/2025:21:56:09 +0300] "GET /static/script.js HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2327
192.168.0.114 - - [11/Oct/2025:21:56:09 +0300] "GET /static/style.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2496
192.168.0.114 - - [11/Oct/2025:21:56:09 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2446
192.168.0.114 - - [11/Oct/2025:21:56:31 +0300] "GET /dashboard HTTP/1.1" 200 2527 "http://192.168.0.205:8781/settings" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 40192
192.168.0.114 - - [11/Oct/2025:21:56:31 +0300] "GET /static/style.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2419
192.168.0.114 - - [11/Oct/2025:21:56:31 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2488
192.168.0.114 - - [11/Oct/2025:21:56:31 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2535
192.168.0.114 - - [11/Oct/2025:21:56:31 +0300] "GET /static/script.js HTTP/1.1" 304 0 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 28861
192.168.0.114 - - [11/Oct/2025:21:56:35 +0300] "GET /logout HTTP/1.1" 302 189 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 3949
192.168.0.114 - - [11/Oct/2025:21:56:35 +0300] "GET / HTTP/1.1" 200 1189 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 39010
192.168.0.114 - - [11/Oct/2025:21:56:35 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2368
192.168.0.114 - - [11/Oct/2025:21:56:35 +0300] "GET /static/css/login.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2249
192.168.0.114 - - [11/Oct/2025:21:56:35 +0300] "GET /static/style.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2304
192.168.0.114 - - [11/Oct/2025:21:56:35 +0300] "GET /static/logo_login.jpg HTTP/1.1" 304 0 "http://192.168.0.205:8781/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2436
192.168.0.114 - - [11/Oct/2025:21:56:35 +0300] "GET /static/script.js HTTP/1.1" 304 0 "http://192.168.0.205:8781/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2435
192.168.0.114 - - [11/Oct/2025:21:56:50 +0300] "POST / HTTP/1.1" 302 207 "http://192.168.0.205:8781/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 10225
192.168.0.114 - - [11/Oct/2025:21:56:50 +0300] "GET /dashboard HTTP/1.1" 200 2527 "http://192.168.0.205:8781/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 9905
192.168.0.114 - - [11/Oct/2025:21:56:50 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2470
192.168.0.114 - - [11/Oct/2025:21:56:50 +0300] "GET /static/style.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2325
192.168.0.114 - - [11/Oct/2025:21:56:50 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 3243
192.168.0.114 - - [11/Oct/2025:21:56:50 +0300] "GET /static/script.js HTTP/1.1" 304 0 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2667
192.168.0.114 - - [11/Oct/2025:21:56:57 +0300] "GET /main_scan HTTP/1.1" 200 1981 "http://192.168.0.205:8781/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 7045
192.168.0.114 - - [11/Oct/2025:21:56:57 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/main_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2428
192.168.0.114 - - [11/Oct/2025:21:56:57 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "http://192.168.0.205:8781/main_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2313
192.168.0.114 - - [11/Oct/2025:21:56:57 +0300] "GET /static/script.js HTTP/1.1" 304 0 "http://192.168.0.205:8781/main_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2307
192.168.0.114 - - [11/Oct/2025:21:56:57 +0300] "GET /static/style.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/main_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 6148
192.168.0.114 - - [11/Oct/2025:21:56:59 +0300] "GET /fg_scan HTTP/1.1" 200 18932 "http://192.168.0.205:8781/main_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 26981
192.168.0.114 - - [11/Oct/2025:21:56:59 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2432
192.168.0.114 - - [11/Oct/2025:21:56:59 +0300] "GET /static/css/scan.css HTTP/1.1" 200 0 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2911
192.168.0.114 - - [11/Oct/2025:21:56:59 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2645
192.168.0.114 - - [11/Oct/2025:21:56:59 +0300] "GET /static/script.js HTTP/1.1" 304 0 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2875
192.168.0.114 - - [11/Oct/2025:21:56:59 +0300] "GET /static/style.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 3597
192.168.0.114 - - [11/Oct/2025:21:57:19 +0300] "POST /fg_scan HTTP/1.1" 200 18932 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 35270
192.168.0.114 - - [11/Oct/2025:21:57:19 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2363
192.168.0.114 - - [11/Oct/2025:21:57:19 +0300] "GET /static/css/scan.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2354
192.168.0.114 - - [11/Oct/2025:21:57:19 +0300] "GET /static/script.js HTTP/1.1" 304 0 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2353
192.168.0.114 - - [11/Oct/2025:21:57:19 +0300] "GET /static/style.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2227
192.168.0.114 - - [11/Oct/2025:21:57:19 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "http://192.168.0.205:8781/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2364