This commit is contained in:
Jason
2026-04-11 00:04:09 -05:00
commit 7a2fffd62e
110 changed files with 51809 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
# Simple Flask Test App
A minimal 2-page Flask application to test Passenger WSGI deployment.
## Pages
- `/` - Home page (Hello World)
- `/about` - About page
- `/test` - Test page (shows system info)
## Local Testing
```bash
cd app_simple
python app.py
```
Visit: http://localhost:8080/
## Server Deployment
### Upload these files to: `/home/bmdwtjuw/product-finder/`
- `app.py`
- `wsgi.py`
- `templates/home.html`
- `templates/about.html`
### Control Panel Configuration
- **Application startup file:** `wsgi.py`
- **Application Entry point:** `app`
- **Python version:** 3.13.11
### Test URLs (after deployment)
- https://columbiawindows.com/product-finder/
- https://columbiawindows.com/product-finder/about
- https://columbiawindows.com/product-finder/test
## What This Tests
✓ Python 3.13.11 compatibility
✓ Flask framework loading
✓ Template rendering
✓ URL routing
✓ Passenger WSGI configuration
Once this works, you can add back the login/user management features from `app2` folder.
+37
View File
@@ -0,0 +1,37 @@
from flask import Flask, render_template
# Initialize Flask
app = Flask(__name__)
@app.route('/')
def home():
"""Home page - Hello World"""
return render_template('home.html')
@app.route('/about')
def about():
"""About page"""
return render_template('about.html')
@app.route('/test')
def test():
"""Test route - no template needed"""
import sys
return f"""
<html>
<head><title>Test Page</title></head>
<body style="font-family: Arial; padding: 20px;">
<h1>Flask App is Running!</h1>
<ul>
<li><strong>Python:</strong> {sys.version}</li>
<li><strong>Flask:</strong> Working</li>
<li><strong>Routes:</strong> {len(list(app.url_map.iter_rules()))}</li>
</ul>
<p><a href="/">Home</a> | <a href="/about">About</a></p>
</body>
</html>
"""
if __name__ == '__main__':
# Run locally on port 8080
app.run(debug=True, host='0.0.0.0', port=8080)
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env python3
"""
Deployment Check Script
Run this on the server to verify configuration
"""
import os
import sys
print("=" * 70)
print("DEPLOYMENT CONFIGURATION CHECK")
print("=" * 70)
# Check Python version
print(f"\nPython Version: {sys.version}")
print(f"Python Executable: {sys.executable}")
# Check current directory
print(f"\nCurrent Directory: {os.getcwd()}")
# Check for required files
print("\n" + "=" * 70)
print("CHECKING FILES")
print("=" * 70)
files_to_check = ['app.py', 'wsgi.py', 'templates/home.html', 'templates/about.html']
for file in files_to_check:
exists = "✓ EXISTS" if os.path.exists(file) else "✗ MISSING"
print(f"{exists}: {file}")
# Check for passenger_wsgi.py (should NOT exist)
if os.path.exists('passenger_wsgi.py'):
print("✗ WARNING: passenger_wsgi.py exists - DELETE THIS FILE!")
else:
print("✓ GOOD: passenger_wsgi.py does not exist")
# Try importing Flask
print("\n" + "=" * 70)
print("CHECKING FLASK")
print("=" * 70)
try:
import flask
print(f"✓ Flask version: {flask.__version__}")
except ImportError as e:
print(f"✗ Flask not installed: {e}")
# Try importing the app
print("\n" + "=" * 70)
print("CHECKING APP IMPORT")
print("=" * 70)
try:
from app import app
print("✓ App imported successfully")
print(f"✓ App name: {app.name}")
print(f"✓ Routes count: {len(list(app.url_map.iter_rules()))}")
except Exception as e:
print(f"✗ Error importing app: {e}")
import traceback
traceback.print_exc()
print("\n" + "=" * 70)
print("DONE")
print("=" * 70)
+2
View File
@@ -0,0 +1,2 @@
Flask==3.0.0
Werkzeug==3.0.1
+62
View File
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>About - Simple Flask App</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 50px auto;
padding: 20px;
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
color: white;
}
.container {
background: rgba(255, 255, 255, 0.1);
padding: 40px;
border-radius: 10px;
backdrop-filter: blur(10px);
}
h1 {
margin: 0 0 20px 0;
font-size: 2.5em;
}
a {
color: #ffd700;
text-decoration: none;
font-weight: bold;
}
a:hover {
text-decoration: underline;
}
.nav {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid rgba(255, 255, 255, 0.3);
}
</style>
</head>
<body>
<div class="container">
<h1>About This App</h1>
<p>This is a simple 2-page Flask application created to test server deployment configuration.</p>
<p><strong>Purpose:</strong> Verify that Passenger WSGI configuration works correctly.</p>
<h2>Configuration:</h2>
<ul>
<li><strong>Startup file:</strong> wsgi.py</li>
<li><strong>Entry point:</strong> app</li>
<li><strong>Framework:</strong> Flask 3.0.0</li>
<li><strong>Python:</strong> 3.13.11</li>
</ul>
<div class="nav">
<a href="/">Home</a> |
<a href="/about">About</a> |
<a href="/test">Test</a>
</div>
</div>
</body>
</html>
+54
View File
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home - Simple Flask App</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 50px auto;
padding: 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.container {
background: rgba(255, 255, 255, 0.1);
padding: 40px;
border-radius: 10px;
backdrop-filter: blur(10px);
}
h1 {
margin: 0 0 20px 0;
font-size: 2.5em;
}
a {
color: #ffd700;
text-decoration: none;
font-weight: bold;
}
a:hover {
text-decoration: underline;
}
.nav {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid rgba(255, 255, 255, 0.3);
}
</style>
</head>
<body>
<div class="container">
<h1>Hello World!</h1>
<p>Welcome to the simple Flask application.</p>
<p>This is a minimal test to verify the server configuration works correctly.</p>
<div class="nav">
<a href="/">Home</a> |
<a href="/about">About</a> |
<a href="/test">Test</a>
</div>
</div>
</body>
</html>
+4
View File
@@ -0,0 +1,4 @@
from app import app
if __name__ == "__main__":
app.run()