File tree 6 files changed +77
-0
lines changed
6 files changed +77
-0
lines changed Original file line number Diff line number Diff line change
1
+ * .db
Original file line number Diff line number Diff line change
1
+ ## Code Challenge 15 - Create a Simple Flask App
2
+
3
+ Instructions [ here] ( http://pybit.es/codechallenge15.html ) .
4
+
5
+ Previous challenges and About [ here] ( http://pybit.es/pages/challenges.html ) .
Original file line number Diff line number Diff line change
1
+ from flask import Flask , render_template
2
+
3
+ # persistence
4
+ #
5
+ # could go with serialization
6
+ # import shelve
7
+ # or:
8
+ # import pickle
9
+ #
10
+ # could go with stdlib DB
11
+ # import sqlite3
12
+ #
13
+ # could go with ORM
14
+ # $ pip install flask_sqlalchemy
15
+ # add:
16
+ # from flask_sqlalchemy import SQLAlchemy
17
+
18
+ app = Flask (__name__ )
19
+
20
+
21
+ @app .route ('/' )
22
+ def index ():
23
+ pass
24
+
25
+
26
+ if __name__ == '__main__' :
27
+ app .run (debug = True )
Original file line number Diff line number Diff line change
1
+ click == 6.7
2
+ Flask == 0.12.1
3
+ itsdangerous == 0.24
4
+ Jinja2 == 2.9.6
5
+ MarkupSafe == 1.0
6
+ Werkzeug == 0.12.1
Original file line number Diff line number Diff line change
1
+ /* some styles, add/update/delete as you want */
2
+
3
+ body {
4
+ text-align : center;
5
+ }
6
+
7
+ .centered {
8
+ margin : auto;
9
+ width : 20% ;
10
+ }
11
+
12
+ .thick-border {
13
+ border : 3px solid black;
14
+ border-collapse : collapse;
15
+ }
16
+
17
+ th , td {
18
+ border : 1px solid black;
19
+ border-collapse : collapse;
20
+ }
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+
3
+ <!-- some boilerplate, delete or modify as you wish -->
4
+
5
+ < link rel ="stylesheet " type ="text/css " href ="{{ url_for('static', filename='style.css') }} ">
6
+
7
+ < table class ="centered thick-border ">
8
+ < tr >
9
+ < th > col1</ th >
10
+ < th > col2</ th >
11
+ </ tr >
12
+ {% for k, v in data.items() %}
13
+ < tr >
14
+ < td > {{ k }}</ td >
15
+ < td > {{ v }}</ td >
16
+ </ tr >
17
+ {% endfor %}
18
+ </ table >
You can’t perform that action at this time.
0 commit comments