diff --git a/.gitignore b/.gitignore index ba0430d..c18dd8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -__pycache__/ \ No newline at end of file +__pycache__/ diff --git a/app/__init__.py b/app/__init__.py index 201849e..75430c9 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -14,13 +14,18 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import os + from flask import Flask, render_template class CalendarSocialApp(Flask): - def __init__(self, name): + def __init__(self, name, config=None): Flask.__init__(self, name) + config_name = os.environ.get('ENV', config or 'dev') + self.config.from_pyfile(f'config_{config_name}.py', True) + app = CalendarSocialApp(__name__) diff --git a/app/config_dev.py b/app/config_dev.py new file mode 100644 index 0000000..88c898f --- /dev/null +++ b/app/config_dev.py @@ -0,0 +1,2 @@ +DEBUG = True +ENV = 'dev'