Table of contents
1.
Introduction
2.
Command Options of web2py
3.
Frequently Asked Questions
3.1.
What is the web2py framework?
3.2.
What is the stable version of Web2py?
3.3.
What is the meaning of -C, --cron command options of web2py?
3.4.
Does Python 3 support web2py?
3.5.
Which companies use web2py?
4.
Conclusion
Last Updated: Mar 27, 2024
Easy

The command options of web2py

Author ANJU JAISWAL
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Web2py is written in Python and programmable in Python. Web2py is a free, open-source web framework for the agile development of secure database-driven online applications. As a full-stack framework, web2py has every element required to create entirely working web applications.

The command options of web2py

Command Options of web2py

Hi Ninja🥷! As you already have a brief idea about web2py here we will look into a brief overview of GUI  and how can we skip it by command options.

Through the use of menus, icons, and other visual cues or representations, a user interacts with electronic devices like computers and smartphones using a graphical user interface (GUI) (graphics). Unlike text-based interfaces, where commands and data are strictly in text, GUIs graphically display information and related user controls. A pointing device, such as a trackball, mouse, stylus, or a finger on a touch screen, is used to manipulate GUI representations.

It is possible to skip the Graphical User Interface(GUI) and start command options of web2py by typing something like:

python web2py.py -a 'your password' -i 127.0.0.1 -p 8000

 

The command options of web2py stores the hashed password in a file called "parameters 8000.py" when it first launches. Web2py asks you for the password if you use " " as the password.

You can launch web2py with the command:

python web2py.py -a '<recycle>' -i 127.0.0.1 -p 8000

 

Command options of web2py makes use of the previously saved hashed password in this instance. The web-based admin interface is disabled if no password is entered or the "parameters 8000.py" file is removed.

If the password on some Unix/Linux systems is

<pam_user:some_user>

 

Unless the PAM configuration forbids it, web2py uses the PAM password of the Operating System account of some user to authenticate the administrator.

Web2py can also run with PyPy and Jython, but it typically runs with CPython (Guido van Rossum's C implementation of the Python interpreter). The second option enables the use of web2py within a Java EE infrastructure. Simply substitute "jython web2py.py..." for "python web2py.py..." to use Jython.

The "web2py.py" script can take many command options of web2py arguments specifying the maximum number of threads, enabling SSL, etc. For a complete list type:

>>> python web2py.py -h
Usage: python web2py.py
web2py Web Framework startup script. ATTENTION: unless a password
is specified (-a 'passwd'), web2py will attempt to run a GUI.
In this case, command options of web2py are ignored.

 

The following table will show some of the command options of web2py.

  Command Options of Web2py                         Values 
  --version 

Show program's version number and exit

 

-p PORT, --port=PORT port of server (8000)
-h, --help   

show this help message and exit

 

-a PASSWORD, --password=PASSWORD

password to be used for the administration (use -a

 "<recycle>" to reuse the last password))

-i IP, --ip=IP  IP address of the server (such as 127.0.0.1 or::1); Note: When using the 'interfaces' option, this value is ignored.
-k SSL_PRIVATE_KEY, --ssl_private_key=SSL_PRIVATE_KEY

file that contains ssl private key

 

-c SSL_CERTIFICATE, --ssl_certificate=SSL_CERTIFICATE

the file that contains an ssl certificate

 

--ca-cert=SSL_CA_CERTIFICATE To verify client X509 certificates, use this file that contains the CA certificate.
-l LOG_FILENAME, --log_filename=LOG_FILENAME

file to log connections

 

-d PID_FILENAME, --pid_filename=PID_FILENAME

file to keep the server's PID

 

-n NUMTHREADS, --numthreads=NUMTHREADS number of threads (deprecated)
--maxthreads=MAXTHREADS maximum number of server threads
--minthreads=MINTHREADS minimum number of server threads
-q REQUEST_QUEUE_SIZE, --request_queue_size=REQUEST_QUEUE_SIZE

maximum number of requests in the queue when the server is down

 

-s SERVER_NAME, --server_name=SERVER_NAME

the server name for the web server

 

-o TIMEOUT, --timeout=TIMEOUT timeout for the individual request (10 seconds)

Also see, How to Check Python Version in CMD

Frequently Asked Questions

What is the web2py framework?

An open-source web application framework icalled Web2py. It enables the creation and design of dynamic web applications.

What is the stable version of Web2py?

Web2py stable version is 2.14.6, which was released on May 10,2016.

What is the meaning of -C, --cron command options of web2py?

These  Command options of web2py means to trigger a cron run manually, usually invoked from a system crontab.

Does Python 3 support web2py?

Web2py functions on Python 2.7 and Python 3 with CPython (the C implementation) and PyPy (Python written in Python).

Which companies use web2py?

Web2py is used by a number of businesses, such as Reactable Systems, Daimler AG, LIBRES EN CRISTO, Pricetack, etc.

Conclusion

In this article, we discussed that command options of web2py can skip GUI with instances and a brief idea that the functioning of web2py is based on model-view-controller and deals with URL  Mapping / Dispatching.

Here are a few key websites that will aid in your exploration of Web2py

 

Refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and AlgorithmsCompetitive ProgrammingJavaScriptSystem DesignMachine learning, and many more! If you want to test your competency in coding, you may check out the mock test series and participate in the contests hosted on Coding Ninjas Studio! But if you have just started your learning process and are looking for questions asked by tech giants like Amazon, Microsoft, Uber, etc, you must look at the problemsinterview experiences, and interview bundle for placement preparations.

Nevertheless, you may consider our paid courses to give your career an edge over others!

Do upvote our blogs if you find them helpful and engaging!

Happy Learning!!

Thank You

Live masterclass