forked from komalharshita/DevPath
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
39 lines (29 loc) · 1.04 KB
/
app.py
File metadata and controls
39 lines (29 loc) · 1.04 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
# app.py
# Application entry point for DevPath.
#
# Responsibilities:
# - Create the Flask app instance
# - Register the main Blueprint from routes/
# - Register error handlers
# - Start the development server when run directly
#
# Business logic, recommendation scoring, and data loading all live in
# the utils/ and routes/ packages, not here.
from flask import Flask, render_template
from routes.main_routes import main
app = Flask(__name__)
# Register all routes defined in the main Blueprint
app.register_blueprint(main)
# ---- Error handlers ----
@app.errorhandler(404)
def page_not_found(error):
"""Render a friendly 404 page instead of the raw Flask error."""
return render_template("404.html"), 404
@app.errorhandler(500)
def internal_server_error(error):
"""Render a friendly 500 page for unexpected server errors."""
return render_template("500.html"), 500
if __name__ == "__main__":
# debug=True is only for local development.
# Never run with debug=True in a production deployment.
app.run(debug=True)