Skip to content

Commit

Permalink
Merge pull request anru#25 from vaab/master
Browse files Browse the repository at this point in the history
Adding HOST, PORT, and PYTHON_PATH config options in ``settings.py``
  • Loading branch information
anru committed Nov 22, 2013
2 parents 326c8fb + 3b5e766 commit 66700aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion application.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,5 @@ def del_rst():


if __name__ == '__main__':
app.run(host='0.0.0.0')
app.run(host=app.config.get('HOST', '0.0.0.0'),
port=app.config.get('PORT', 5000))
3 changes: 2 additions & 1 deletion sbin/rsted
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class RstedDaemon(BaseDaemon):
NO_WRITE_PID = True

def run(self):
os.system('python ' + J(app.config.root_path, 'rsted.fcgi'))
os.system('%s %s' % (app.config.get('PYTHON_PATH', 'python'),
J(app.config.root_path, 'rsted.fcgi')))

def print_status(self):
pidexists = os.path.exists(self.pidfile)
Expand Down
6 changes: 6 additions & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
SOCKET_FILE = 'rsted.sock'
FCGI_UMASK = '000' # you can override this in settings_local.py if you wish

HOST = "0.0.0.0" ## Listen IP
## 0.0.0.0 is open to everyone,
## 127.0.0.1 is localhost only.
PORT = 5000


try:
from settings_local import *
except ImportError:
Expand Down

0 comments on commit 66700aa

Please sign in to comment.