Skip to content

Commit be8d715

Browse files
Allow specifying port and host in run command
1 parent 6ad4cbe commit be8d715

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pythoncms/cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,16 @@ def seed():
119119

120120
@cli.command("run")
121121
@click.option("--debug", is_flag=True, default=True)
122-
def run(debug):
122+
@click.option("--port", default=5000, help="Port to run the server on")
123+
@click.option("--host", default="127.0.0.1", help="Host to bind to")
124+
def run(debug, port, host):
123125
"""Run the development server"""
124126
bin_dir = os.path.dirname(sys.executable)
125127
flask_cmd = os.path.join(bin_dir, "flask")
126128
args = [flask_cmd]
127129
if debug:
128130
args.append("--debug")
129-
args.append("run")
131+
args.extend(["run", "--port", str(port), "--host", host])
130132
subprocess.run(args, check=True)
131133

132134

0 commit comments

Comments
 (0)