@@ -37,19 +37,18 @@ def error(self, req):
37
37
'''
38
38
39
39
@click .command ('start' )
40
- @click .option ('--port' , '-p' , default = 9999 )
40
+ @click .option ('--port' , '-p' , default = 9999 , help = "FastCGI port number on localhost" )
41
41
@click .option ('--ip' , '-h' , default = '127.0.0.1' )
42
- @click .option ('--vhost' , '-v' , default = 'cloudfire-demo.coinkite.com' )
42
+ @click .option ('--vhost' , '-v' , help = "Virtual hostname to use" )
43
43
@click .option ('--redis-url' , '-r' , default = 'redis://localhost:6379/' , help = "URL for Redis server" )
44
- @click .option ('--debug ' , '-d' , is_flag = True , help = "Runs locally as web server" )
45
- def start_server (ip , port , debug , redis_url , vhost ):
44
+ @click .option ('--devmode ' , '-d' , is_flag = False , help = "Runs locally as web server. Dev only " )
45
+ def start_server (ip , port , devmode , redis_url , vhost ):
46
46
from example_app import app
47
47
48
48
RDB = redis .Redis .from_url (redis_url )
49
49
50
50
app .my_vhosts .append (vhost )
51
51
app .redis = RDB
52
- app .debug = True
53
52
54
53
app .start_bg_tasks ()
55
54
@@ -61,8 +60,9 @@ def start_server(ip, port, debug, redis_url, vhost):
61
60
sys .exit (1 )
62
61
63
62
64
- if debug :
65
- app .run (host = "0.0.0.0" , port = port , debug = True )
63
+ if devmode :
64
+ app .debug = True
65
+ app .run (host = "0.0.0.0" , port = port )
66
66
else :
67
67
print "Running as FastCGI at %s:%d" % (ip , port )
68
68
MyWSGIServer (app , bindAddress = (ip , port ), multiplexed = True , umask = 0 ).run ()
0 commit comments