Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'develop' of git://github.com/klen/Flask-Foundation

  • Loading branch information...
commit ad5ea8b601dcc85d8d8d82278b65096b873103e6 2 parents 3d9da3f + 5e77336
@klen authored
View
10 base/config/core.py
@@ -1,4 +1,7 @@
-" Core configuration settings. "
+""" Immutable basic settings.
+"""
+
+import logging
from base.config import op, ROOTDIR
@@ -24,4 +27,7 @@
MAIL_USE_SSL = True
MAIL_USERNAME = None
MAIL_PASSWORD = None
-DEFAULT_MAIL_SENDER = MAIL_USERNAME and ('Admin <%s>' % MAIL_USERNAME) or None
+DEFAULT_MAIL_SENDER = None
+
+logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', datefmt='%d.%m %H:%M:%S')
+logging.info("Core settings loaded.")
View
5 base/config/develop.py
@@ -1,11 +1,14 @@
-" Settings for develop process. "
+""" Development settings.
+"""
from .production import *
+MODE = 'develop'
DEBUG = True
DEBUG_TB_INTERCEPT_REDIRECTS = False
SQLALCHEMY_ECHO = True
+logging.info("Develop settings loaded.")
# pymode:lint_ignore=W0614,W404
View
2  base/config/production.py
@@ -5,6 +5,7 @@
from datetime import timedelta
+MODE = 'production'
SECRET_KEY = 'SecretKeyForSessionSigning'
ADMINS = MAIL_USERNAME and [MAIL_USERNAME] or None
@@ -46,5 +47,6 @@
MAIL_USERNAME, MAIL_PASSWORD = f.read().strip().split(' ')
ADMINS = [MAIL_USERNAME]
+logging.info("Production settings loaded.")
# pymode:lint_ignore=W0614,W404
View
2  base/config/test.py
@@ -3,6 +3,7 @@
from .production import *
+MODE = 'test'
TESTING = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:'
CSRF_ENABLED = False
@@ -10,5 +11,6 @@
AUTH_USER_MIXINS += ['base.auth.tests.TestUserMixin']
+logging.info("Test settings loaded.")
# pymode:lint_ignore=W0614,W404
View
2  base/core/templates/core/base.html
@@ -46,4 +46,6 @@
{% if config.get('FOUNDATION_METRIKA') %} {% include "core/blocks/metrika.html" %} {% endif %}
{% if config.get('FOUNDATION_ANALYTICS') %} {% include "core/blocks/analytics.html" %} {% endif %}
+ <!-- {{ config.get('MODE', 'unknown' ) }}:{{ config.get('DEBUG', False) }} -->
+
{% endblock %}
Please sign in to comment.
Something went wrong with that request. Please try again.