Skip to content

Instantly share code, notes, and snippets.

@sivy
Created June 22, 2013 23:38
Show Gist options
  • Save sivy/5843124 to your computer and use it in GitHub Desktop.
Save sivy/5843124 to your computer and use it in GitHub Desktop.
# __init__.py
from apps.home.views import home
app.register_blueprint(home)
# 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