# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from flask import Flask, render_template

from app.settings import Settings


class Application(Flask):
    config_name = None

    def __init__(self, config_name=None, **kwargs):
        super(Application, self).__init__(__name__, **kwargs)
        self.settings = Settings(app=self, config_name=config_name)
        self.register_views(app=self)

    @staticmethod
    def register_views(app):
        # pylint: disable=unused-variable

        @app.route('/')
        def index_page():
            return render_template('index.html', text=(
                app.config_name + ' : ' + str(app.settings.MY_CONST)))


if __name__ == '__main__':
    app_obj = Application('development')
    app_obj.run(host='0.0.0.0', port='5000')
