.. image:: https://travis-ci.org/web2py/py4web.svg?branch=master :target: https://travis-ci.org/web2py/py4web
PY4WEB is a web framework for rapid development of efficient database driven web applications. It is an evolution of the popular web2py framework but much faster and slicker.
BSD-3-Clause License__
Screenshots
Running py4web
.. image:: docs/images/first_run.png
The main Dashboard
.. image:: docs/images/dashboard_main.png
Editing a file in the Dashboard
.. image:: docs/images/dashboard_edit.png
Editing a database in the Dashboard
.. image:: docs/images/dashboard_restapi.png
Installation
PY4WEB runs fine on Windows, MacOS and Linux. There are many installation procedures (see the official documentation for details) but only two of them are summarized here.
The simplest way to install py4web is using binaries, but it's only available for Windows and MacOS. It's meant especially for newbies or students, because it does not require Python pre-installed on your system nor administrative rights. You just need to download the latest Windows or MacOS ZIP file from
this external repository__. Unzip it on a local folder and open a command line there. Finally run the commands (omit './' if you're using Windows)
.. code:: bash
./py4web-start set_password ./py4web-start run apps
The standard installation procedure for py4web on Windows, MacOS and Linux is using pip. Its only prerequisite is Python 3.6+.
.. code:: bash
python3 -m pip install --upgrade py4web --no-cache-dir --user
but do not type the ''--user'' option with virtualenv or a standard Windows installation which is already per-user. Also, if ''python3'' does not work, try with the simple ''python'' command instead.
This will install the latest stable release of py4web and all its dependencies on the system's path only. After the installation you'll be able to start py4web on any given working folder with
.. code:: bash
py4web setup apps py4web set_password py4web run apps
Launch Arguments
.. code-block:: none
# py4web run -h
Usage: py4web.py run [OPTIONS] [APPS_FOLDER]
Run all the applications on apps_folder
Options: -Y, --yes No prompt, assume yes to questions [default: False]
-H, --host TEXT Host name [default: 127.0.0.1] -P, --port INTEGER Port number [default: 8000] -p, --password_file TEXT File for the encrypted password [default: password.txt]
-s, --server [default|wsgiref|tornado|gunicorn|gevent|waitress|geventWebSocketServer|wsgirefThreadingServer] server to use [default: default] -w, --numberworkers INTEGER Number of workers [default: 0] -d, --dashboardmode TEXT Dashboard mode: demo, readonly, full (default), none [default: full]
--watch [off|sync|lazy] Watch python changes and reload apps automatically, modes: off (default), sync, lazy --sslcert PATH SSL certificate file for HTTPS --sslkey PATH SSL key file for HTTPS -help, -h, --help Show this message and exit.
Example:
.. code:: bash
py4web run -H 127.0.0.1 -P 8000 -d demo apps
Note that since the default (as specified above) for the host and port are 127.0.0.1 and 8000 respectively, the above command can be shortened to:
.. code:: bash
py4web run -d demo apps
Note also that the optional ''usegevent'' directive must be used with ''gevent'' or ''geventWebSocketServer'' webservers and shouldn't be used with ''tornado'' and ''waitress''.
WSGI
py4web is a WSGI application. To obtain the WSGI app simply do:
.. code:: bash
from py4web.core import wsgi application = wsgi()
The wsgi function takes arguments with the same name as the command line arguments.
Tell me more
Memoize__
Contributors
py4web is supported by a growing community of developers and even simple users. Many thanks to everybody, and especially:
.. inclusion-marker-do-not-remove
Massimo Di Pierro__
Cassio Botaro__
Dan Carroll__
Jim Steil__
John M. Wolf__
Micah Beasley__
Nico Zanferrari__
Pirsch__
sugizo__
valq7711__