diff options
| author | yo mama <pepper@scannerjammer.com> | 2016-08-23 11:08:54 -0700 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2016-08-23 11:08:54 -0700 |
| commit | c42f2684cad8d29b20540076349cc2fcec1573c9 (patch) | |
| tree | 59ec71564e34a418e1f88a7475dec0e6b1f74a68 /run_server.py | |
| parent | 0c238e0bd38573f4b8fa2fdf16d46960f9920fec (diff) | |
good
Diffstat (limited to 'run_server.py')
| -rw-r--r-- | run_server.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/run_server.py b/run_server.py index 63b932c..2e0a3c1 100644 --- a/run_server.py +++ b/run_server.py @@ -1,6 +1,7 @@ #!/usr/bin/python2 """script used to run the webserver""" import sys +from subprocess import Popen from photoblaster.server import Server from photoblaster.config import LOCAL @@ -13,8 +14,16 @@ if __name__ == "__main__": "RUNNING LOCAL VERSION OF SERVER\n" "TO RUN PRODUCTION VERSION SET ENVIRONMENT VARIABLE" "PB_PRODUCTION=1...ie\n" - "$>export PB_PRODUCTION=1" + "$>export PB_PRODUCTION=1\n" ) + #test if nginx is running + test = Popen(['pgrep', 'nginx']) + test.communicate() + if test.returncode: + sys.stderr.write( + "ERROR:\n" + "you must start nginx to serve static content\n") + sys.exit(1) server.run() else: server.run_wsgi() |
