Skip to content

Commit

Permalink
Use Jinja2 templates
Browse files Browse the repository at this point in the history
  • Loading branch information
evandbrown committed Jul 12, 2013
1 parent fb750d9 commit 9defb91
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .ebextensions/python.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
option_settings:
- namespace: aws:elasticbeanstalk:container:python:staticfiles
option_name: /static/
value: static/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
release/
*.pyc
*.pyc
.elasticbeanstalk/
5 changes: 3 additions & 2 deletions application.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

@application.route('/')
def hello_world():
return "Hello world!"
message = "Hello, world!"
return flask.render_template('index.html', title=message)

if __name__ == '__main__':
application.run(host='0.0.0.0', debug=True)
application.run(host='0.0.0.0', debug=True)
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Flask==0.10.1
Flask==0.10.1
Jinja2==2.7
Werkzeug==0.9.1
wsgiref==0.1.2
8 changes: 8 additions & 0 deletions static/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
h1 {
font-family:arial, helvetica;
}

body {
margin:50px 0px; padding:0px;
text-align:center;
}
10 changes: 10 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<title> {{ title }}</title>
<link href="{{ url_for('static', filename="css/style.css") }}" rel="stylesheet">
</head>
<body>
<h1>{{ title }}</h1>
</body>
</html>

0 comments on commit 9defb91

Please sign in to comment.