Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Hopefully fix the mixed config type
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven-Hendrik Haase committed Apr 30, 2013
1 parent 7605ea5 commit d646c39
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions flamejam.wsgi
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions flamejam/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os, sys
from flask import Flask
from datetime import *
from flask.ext.mail import Mail
Expand All @@ -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)
Expand Down

0 comments on commit d646c39

Please sign in to comment.