Skip to content

Commit

Permalink
make mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
qiwsir committed Nov 6, 2014
1 parent 7bfc52c commit aefafce
Show file tree
Hide file tree
Showing 5 changed files with 485 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Thumbs.db
*.sw[a-z]
._*

# md
*.md~

# PhpStorm (IDE) project files
.idea/*

Expand Down
2 changes: 1 addition & 1 deletion BasicPython/codes/temploop/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<DOCTYPE html>
<html>
<head>
<link href="{{static_url("style.css")}}" rel="stylesheet">
<title>Loop in template</title>
</head>
<body>
<h1>aaaAAA</h1>
<p>There is a list, it is <b>{{info}}</b></p>
<p>I will print the elements of this list in order.</p>
{% for element in info %}
Expand Down
6 changes: 4 additions & 2 deletions BasicPython/codes/temploop/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ def get(self):
handlers = [(r"/", IndexHandler),]

template_path = os.path.join(os.path.dirname(__file__), "temploop")
static_path = os.path.join(os.paht.dirname(__file__), "static")
#static_path = os.path.join(os.path.dirname(__file__), "static")
static_path = "./static"

if __name__ == "__main__":
tornado.options.parse_command_line()
app = tornado.web.Application(handlers, template_path, static)
#app = tornado.web.Application(handlers, template_path, static_path,)
app = tornado.web.Application(handlers, template_path, debug=True)
http_server = tornado.httpserver.HTTPServer(app)
http_server.listen(options.port)
tornado.ioloop.IOLoop.instance().start()
11 changes: 11 additions & 0 deletions BasicPython/codes/temploop/static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
body {
color: #000;
background: #fff;
margin: 0 auto;
padding: 0;
}

p {
text-align: center;
color: black;
}
Loading

0 comments on commit aefafce

Please sign in to comment.