Created
June 22, 2013 23:38
-
-
Save sivy/5843124 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# __init__.py | |
from apps.home.views import home | |
app.register_blueprint(home) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# apps/home/views.py | |
home = Blueprint('home', __name__, url_prefix='') | |
class IndexView(MethodView): | |
method = ['GET', 'HEAD'] | |
def head(self): | |
self.response.status_int = 200 | |
def get(self): | |
return self.template_out('index.html', template_values={ | |
'session': session, | |
'latest_post': blog_post, | |
}) | |
index_view = IndexView.as_view('home_index') | |
home.add_url_rule('/', view_func=index_view) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment