diff options
| author | Teddy Wing | 2015-01-31 18:59:36 -0500 |
|---|---|---|
| committer | Teddy Wing | 2015-01-31 21:14:20 -0500 |
| commit | d3e8f7e010bf60bc0837cfe4e106d8133ce31ce6 (patch) | |
| tree | 972f13735cbb86e8f26277f402fe752680eda6a0 | |
| parent | f0df9efaaf56b35c7b41d818bfa6f09b7aceb38e (diff) | |
| download | edu-net-index-page.tar.bz2 | |
Render base.html at index pageindex-page
* Update routes to use the `add_url_rule` syntax
* Create base.html
* Create a home module and views.py file to serve the home page
| -rw-r--r-- | app.py | 6 | ||||
| -rw-r--r-- | modules/home/__init__.py | 0 | ||||
| -rw-r--r-- | modules/home/views.py | 4 | ||||
| -rw-r--r-- | templates/base.html | 18 |
4 files changed, 25 insertions, 3 deletions
@@ -4,6 +4,8 @@ from flask import Flask from flask_user import SQLAlchemyAdapter, UserManager +from modules.home.views import index_view + from modules.shared.models import db from modules.interest.models import Interest, UserInterest from modules.user.models import User, UserAuth @@ -24,9 +26,7 @@ with app.app_context(): db_adapter = SQLAlchemyAdapter(db, User, UserAuthClass=UserAuth) user_manager = UserManager(db_adapter, app) -@app.route("/") -def hello(): - return "Hello World!" +app.add_url_rule('/', 'index', index_view) if __name__ == "__main__": app.run() diff --git a/modules/home/__init__.py b/modules/home/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/modules/home/__init__.py diff --git a/modules/home/views.py b/modules/home/views.py new file mode 100644 index 0000000..3d18aa8 --- /dev/null +++ b/modules/home/views.py @@ -0,0 +1,4 @@ +from flask import render_template + +def index_view(): + return render_template('base.html') diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..c045a51 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,18 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta http-equiv="cache-control" content="no-cache" /> + <title>Website</title> + <meta name="description" content=""> + + <meta name="viewport" content="width=device-width"> + + <style type="text/css"> + html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0} + </style> +</head> +<body> + Hello World +</body> +</html> |
