Skip to content

Commit

Permalink
Add wsgi.py for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
tkiapril committed Nov 18, 2014
1 parent 7bba70d commit 9eb7f87
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 0 additions & 1 deletion deploy/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def main():
if args.sentry_dsn is not None and \
args.sentry_dsn[0] is not None:
config['SENTRY_DSN'] = args.sentry_dsn[0]
config['uwsgi']['env'] = 'SENTRY_DSN={}'.format(args.sentry_dsn[0])

if args.identity is not None and args.identity[0] is not None:
args.identity[0] = os.path.abspath(args.identity[0])
Expand Down
13 changes: 13 additions & 0 deletions deploy/etc/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pathlib

from cliche.web.app import app, setup_sentry
from cliche.config import read_config


config = read_config(filename=pathlib.Path('/home/cliche/etc/prod.cfg.py'))
app.config.update(config)
setup_sentry()


if __name__ == "__main__":
app.run()
3 changes: 2 additions & 1 deletion deploy/prod.cfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ uwsgi:
chdir: /home/cliche
chmod-socket: 666
callable: app
module: cliche.web.app
module: wsgi
socket: /tmp/cliche-uwsgi.sock
plugins: python34
1 change: 1 addition & 0 deletions deploy/scripts/upgrade-common.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def main():
config = load(config_data)

config['uwsgi']['virtualenv'] = str(venv_dir)
config['uwsgi']['pythonpath'] = str(venv_dir / 'etc')

with (venv_dir / 'etc' / 'prod.cfg.yml').open('w') as f:
print(dump(config), file=f)
Expand Down

0 comments on commit 9eb7f87

Please sign in to comment.