Permalink
Browse files

Hopefully fix the mixed config type

  • Loading branch information...
1 parent 7605ea5 commit d646c3969d82153cc24b1a5af98d4c4c5fdf5892 @svenstaro committed Apr 30, 2013
Showing with 12 additions and 10 deletions.
  1. +4 −3 Makefile
  2. +1 −0 flamejam.wsgi
  3. +7 −7 flamejam/__init__.py
View
@@ -21,10 +21,11 @@ install:
cp -r alembic flamejam scripts $(DESTDIR)/srv/flamejam
cp alembic.ini flamejam.wsgi runserver.py Makefile $(DESTDIR)/srv/flamejam/
- install -Dm600 doc/flamejam.cfg.default $(DESTDIR)/etc/flamejam/flamejam.cfg.default
+ mkdir -p $(DESTDIR)/etc/flamejam
- mkdir -p $(DESTDIR)/usr/share/doc/
- cp -r doc $(DESTDIR)/usr/share/doc/flamejam
+ mkdir -p $(DESTDIR)/usr/share/doc/flamejam
+ cp -r doc/* $(DESTDIR)/usr/share/doc/flamejam/
+ chmod 600 $(DESTDIR)/usr/share/doc/flamejam/flamejam.cfg.default
cp LICENSE README.md $(DESTDIR)/usr/share/doc/flamejam/
cd $(DESTDIR)/srv/flamejam && make setup
View
@@ -3,4 +3,5 @@ current_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(current_dir)
activate_this = os.path.join(current_dir, 'env/bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
+os.environ['CONFIG_TYPE'] = 'production'
from flamejam import app as application
View
@@ -1,3 +1,4 @@
+import os, sys
from flask import Flask
from datetime import *
from flask.ext.mail import Mail
@@ -9,13 +10,12 @@
app = Flask(__name__)
-# First load default config
-app.config.from_pyfile('../doc/flamejam.cfg.default', silent=True)
-app.config.from_pyfile('/usr/share/doc/flamejam/flamejam.cfg.default', silent=True)
-app.config.from_pyfile('/etc/flamejam/flamejam.cfg.default', silent=True)
-# Then load user config on top of that
-app.config.from_pyfile('../flamejam.cfg', silent=True)
-app.config.from_pyfile('/etc/flamejam/flamejam.cfg', silent=True)
+if os.environ.get('CONFIG_TYPE') == "production":
+ app.config.from_pyfile('/usr/share/doc/flamejam/flamejam.cfg.default')
+ app.config.from_pyfile('/etc/flamejam/flamejam.cfg', silent=True)
+else:
+ app.config.from_pyfile('../doc/flamejam.cfg.default')
+ app.config.from_pyfile('../flamejam.cfg', silent=True)
mail = Mail(app)
db = SQLAlchemy(app)

0 comments on commit d646c39

Please sign in to comment.