mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
templates/tasks.py: serve: automatically open browser
This commit is contained in:
parent
35bbda4507
commit
3debcf852d
1 changed files with 5 additions and 0 deletions
|
|
@ -82,6 +82,11 @@ def serve(c):
|
|||
(CONFIG['host'], CONFIG['port']),
|
||||
ComplexHTTPRequestHandler)
|
||||
|
||||
if OPEN_BROWSER_ON_SERVE:
|
||||
# Open site in default browser
|
||||
import webbrowser
|
||||
webbrowser.open("http://{host}:{port}".format(**CONFIG))
|
||||
|
||||
sys.stderr.write('Serving at {host}:{port} ...\n'.format(**CONFIG))
|
||||
server.serve_forever()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue