diff --git a/src/humulus/__init__.py b/src/humulus/__init__.py index d62fb58..245940e 100644 --- a/src/humulus/__init__.py +++ b/src/humulus/__init__.py @@ -1,11 +1,11 @@ # Copyright 2019 Mike Shoup - +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at - +# # http://www.apache.org/licenses/LICENSE-2.0 - +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,22 +22,9 @@ def create_app(test_config=None): app = Flask(__name__, instance_relative_config=True) app.config.from_envvar('HUMULUS_SETTINGS') - if test_config is None: - # load the instance config, if it exists, when not testing - app.config.from_pyfile('config.py', silent=True) - else: - # load the test config if passed in - app.config.from_mapping(test_config) - - # ensure the instance folder exists - try: - os.makedirs(app.instance_path) - except OSError: - pass - - # a simple page that says hello - @app.route('/hello') - def hello(): - return 'Hello, World!' + # Register blueprint for index page + from . import home + app.register_blueprint(home.bp) + app.add_url_rule('/', endpoint='index') return app diff --git a/src/humulus/home.py b/src/humulus/home.py new file mode 100644 index 0000000..3e4242a --- /dev/null +++ b/src/humulus/home.py @@ -0,0 +1,25 @@ +"""This module handles routes for the home page""" + +# Copyright 2019 Mike Shoup +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from flask import Blueprint, render_template + +bp = Blueprint('home', __name__) + + +@bp.route('/') +def index(): + """Renders the homepage template""" + return render_template('index.html') diff --git a/src/humulus/templates/index.html b/src/humulus/templates/index.html new file mode 100644 index 0000000..986a4a1 --- /dev/null +++ b/src/humulus/templates/index.html @@ -0,0 +1 @@ +

Hello