Skip to content

Commit

Permalink
Add guidance to kp preview regarding accessing preview when run on …
Browse files Browse the repository at this point in the history
…remote systems.
  • Loading branch information
matthewwardrop committed Dec 17, 2018
1 parent e980350 commit 9b3f8bb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/kp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,17 @@ if args.action == 'preview':
config=None,
INDEXING_ENABLED=False)

url = 'http://127.0.0.1:{}/post/{}'.format(port, post_path)
url = 'http://localhost:{}/post/{}'.format(port, post_path)
print(
"Previewing knowledge post at: {}\n\n"
"If you are using `kp` locally, a browser window will shortly open at "
"this address. Otherwise, please replace `localhost` with the hostname "
"of the server upon which you are running this script, and manually "
"point your browser at the resulting url.\n\n"
"When you are ready to exit the preview, simply kill this process using "
"`<Ctrl> + C`.\n"
.format(url)
)
threading.Timer(1.25, lambda: webbrowser.open(url)).start()

KnowledgeDeployer.using('flask')(
Expand Down

0 comments on commit 9b3f8bb

Please sign in to comment.