Skip to content

Commit

Permalink
Clarify update process and run --host option
Browse files Browse the repository at this point in the history
  • Loading branch information
nicozanf committed Jun 14, 2024
1 parent 0df0be8 commit 73b84a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions docs/chapter-03.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ If you installed py4web from pip you can simple upgrade it with

::

py4web setup apps
py4web setup <path to apps_folder>

in order to re-install them. This is a safety precaution, in case you
made changes to those apps.
Expand Down Expand Up @@ -274,7 +274,7 @@ two apps in this folder: **Dashboard** (``_dashboard``) and **Default**
to avoid conflicts with apps created by you.

Once py4web is running you can access a specific app at the following
urls:
urls from the local machine:

::

Expand Down Expand Up @@ -380,7 +380,7 @@ This currently gives an error on binaries installations and from source installa
-Y, --yes No prompt, assume yes to questions
[default: False]

-H, --host TEXT Host name [default: 127.0.0.1]
-H, --host TEXT Host listening IP [default: 127.0.0.1]
-P, --port INTEGER Port number [default: 8000]
-A, --app_names TEXT List of apps to run, comma separated (all if omitted or
empty)
Expand Down Expand Up @@ -414,6 +414,10 @@ This currently gives an error on binaries installations and from source installa
The ``app_names`` option lets you filter which specific apps you want to serve (comma separated). If absent or empty
all the apps in the APPS_FOLDER will be run.

By default (for security reasons) the py4web framework will listen only on 127.0.0.1, i.e. localhost.
If you need to reach it from other machines you must specify the host option,
like ``py4web run --host 0.0.0.0 apps``.

The ``url_prefix`` option is useful for routing at the py4web level. It allows mapping to multiple versions of py4web
running on different ports as long as the url_prefix and port match the location. For example
``py4web run --url_prefix=/abracadabra --port 8000 apps``.
Expand Down
2 changes: 1 addition & 1 deletion py4web/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@ def new_app(apps_folder, app_name, yes, scaffold_zip):
help="No prompt, assume yes to questions",
show_default=True,
)
@click.option("-H", "--host", default="127.0.0.1", help="Host name", show_default=True)
@click.option("-H", "--host", default="127.0.0.1", help="Host listening IP", show_default=True)
@click.option(
"-P", "--port", default=8000, type=int, help="Port number", show_default=True
)
Expand Down

0 comments on commit 73b84a2

Please sign in to comment.