AppyPrinciplesGetting started
Appy

Appy (Applications in Python) is a GPL framework for building web applications written in the Python programming language.

Installation

Appy runs with Python 3.6 or higher. Ensure you have pip installed. Some parts of the framework depend on LibreOffice, ImageMagick and Ghostscript, but these are weak dependencies: you are not forced to install them to have Appy work.

Install Appy by typing:

pip install appy

That's all folks!

You'll notice that pip has installed some Appy dependencies, most notably the Zope Object Database, the object-oriented database management system used by Appy.

Install Appy in a Python virtualenv

Package managers may complain about installing Appy, as the root user, on the default OS Python interpreter. Indeed, installing and managing Python packages at this level is done via the package manager itself. If you install Appy as a non-root user, Appy and its dependencies will be installed in your home folder, which is fine. When installing Appy on a server, though, I recommand installing it in a Python virtualenv.

If you install Appy on a server, as a preamble, it may be a good idea to create a user named appy.

useradd --system --create-home appy

Then, create a Python virtualenv in appy's home folder:

python3 -m venv /home/appy/.venv

Within the virtualenv, a configuration file has been created, named pyvenv.cfg. It may be a good idea to configure it such that, when the virtualenv is activated, it may access the Python packages being installed at the global interpreter level:

include-system-site-packages = true

Indeed, if you use LibreOffice with Appy, the uno package, representing the bridge between Python and LibreOffice in server mode, may be installed at the global level.

As an internationally-agreed convention, any Appy site running on any server will be executed by the appy user. Consequently, it is a good idea to activate the created virtualenv as soon as the appy user logs in, or when another user switches to appy via the su command (su appy). In order to activate the virtualenv in both cases, and if you use the Bash shell, add the following lines, in /home/appy/.bashrc as well as in /home/appy/.bash_profile:

source /home/appy/.venv/bin/activate

By the way, if you have problems with Python-UNO, it is worth trying to add, in the same files, the definition of these variables:

export PYTHONPATH=/usr/lib[64]/libreoffice/program
export URE_BOOTSTRAP="file://user/lib[64]/libreoffice/program/fundamentalrc"

LibreOffice libraries may be installed in /usr/lib or /usr/lib64, hence the lib[64] notation.

Once this has been done, and you switch to the appy user, as root, by typing su appy, you should get a prompt with a prefix indicating that the virtualenv has been activated, like in this example:

(.venv) appy@hubsessions:~/

Fine! You may now install Appy in this virtualenv by typing:

pip install appy

Python dependencies

If you plan to use LDAP with Appy, you may install python-ldap, being another Appy weak dependency, by typing:

pip install python-ldap

You may ask: what have I done ?

You have installed a full-featured tool for building, in the simpliest possible way, complex web applications.

Appy is not new. The first version of it has been published in 2007.

For many years, a part of Appy has been widely used: appy.pod.

Historically, the web framework part of Appy used to be named appy.gen. Now, it is simply Appy.

I can't resist the temptation to copy the old project homepage.

For Python 2 aficionados 👵👴

Don't depress or retire: the POD part of Appy is still available for you ! Via PIP:

pip install appy

So tell the truth, the .tar.gz file I have uploaded to PIP contains both the Python 2 and Python 3 versions of Appy. It does not mean the same Appy codebase works in Python 2 and Python 3. In the .tar.gz, the 2 distinct codebases are included. When pip is executed, a small cheat tells PIP to copy only the Python 2 or Python 3 code files, depending on the version of the Python interpreter running PIP.

git repository

The Appy git repository is to be found here, at GeezTeem, using a libre software forge named Hubber, itself written with Appy. By the way, the site you are currently consulting is also made with Appy.