Eclectic Media Git archived_em.space_site / 9ca6fde
Initial commit, working app Ariana Giroux 1 year, 1 month ago
7 changed file(s) with 47 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 *.sw*
1 .ropeproject
2 *pycache*
3 *.pyc
4 venv
0 from flask import Flask
1
2 from utilities.renderer import render
3
4 app = Flask(__name__)
5
6
7 @app.route('/')
8 def hello_world():
9 return render('templates/index.stache')
10
11
12 if __name__ == '__main__':
13 app.run()
0 <div style="text-align: center; position: fixed; top: 50%; transform: translateY(-50%); width: 100%;">
1 <h1>Something new is coming!</h1>
2 </div>
0 </body>
1 </html>
0 <!DOCTYPE html>
1 <html lang="en">
2 <head>
3 <meta charset="UTF-8">
4 <title>Eclectic Media Solutions</title>
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
7 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
8 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
9 </head>
0 {{> header }}
1 {{> base }}
2 {{> footer }}
3 {{!vim: sw=2 ts=2 syntax=html:}}
0 import os
1
2 from pystache import Renderer
3
4 renderer = Renderer(search_dirs='templates', file_extension='stache')
5
6 def render(path, context={}):
7 if os.access(path, os.F_OK):
8 return renderer.render_path(path, context)