Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a6844fd

Browse files
committed
Check Log
1 parent 183a6ad commit a6844fd

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

‎api/index.py‎

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
1-
from flask import Flask, render_template
1+
from flask import Flask, render_template, request
2+
import logging
23

34
app = Flask(__name__)
45

6+
# Set up logging
7+
logging.basicConfig(filename='error.log', level=logging.DEBUG)
8+
59
@app.route('/')
610
def home():
7-
return render_template('home.html')
11+
try:
12+
return render_template('home.html')
13+
except Exception as e:
14+
app.logger.error(f"Error rendering home.html: {e}")
15+
return "Internal Server Error", 500
816

917
@app.route('/about')
1018
def about():
11-
return render_template('about.html')
19+
try:
20+
return render_template('about.html')
21+
except Exception as e:
22+
app.logger.error(f"Error rendering about.html: {e}")
23+
return "Internal Server Error", 500
1224

1325
@app.route('/projects')
1426
def projects():
15-
return render_template('projects.html')
27+
try:
28+
return render_template('projects.html')
29+
except Exception as e:
30+
app.logger.error(f"Error rendering projects.html: {e}")
31+
return "Internal Server Error", 500
1632

1733
@app.route('/contact')
1834
def contact():
19-
return render_template('contact.html')
35+
try:
36+
return render_template('contact.html')
37+
except Exception as e:
38+
app.logger.error(f"Error rendering contact.html: {e}")
39+
return "Internal Server Error", 500
2040

2141
if __name__ == '__main__':
2242
app.run(debug=True)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /