Browse Source

starting to load blueprints. display fails due the lack of templates (which I will fix next)

master
Julio Biason 11 years ago
parent
commit
ec8ab8e982
  1. 15
      lyrics/__init__.py
  2. 0
      lyrics/blueprints/__init__.py
  3. 11
      lyrics/blueprints/index.py

15
lyrics/__init__.py

@ -12,6 +12,21 @@ import logging
_log = logging.getLogger('lyrics')
app = Flask(__name__)
app.config['SIDEBAR'] = []
# ----------------------------------------------------------------------
# Import and register blueprints
# ----------------------------------------------------------------------
from lyrics.blueprints.index import index
blueprints = [(index, '/', 'Index')]
for (blueprint, path, title) in blueprints:
_log.debug('{blueprint} => "{path}" as "{title}"'.format(
blueprint=blueprint, path=path, title=title))
app.register_blueprint(blueprint, url_prefix=path)
app.config['SIDEBAR'].append((title, path))
# ----------------------------------------------------------------------
# Start as application

0
lyrics/blueprints/__init__.py

11
lyrics/blueprints/index.py

@ -0,0 +1,11 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from flask import Blueprint
from flask import render_template
index = Blueprint('index', __name__)
@index.route('/')
def root():
return render_template('index.html')
Loading…
Cancel
Save