You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.3 KiB



The only requirements are Python 3 and virtualenv as you're going to install all the modules through pip.

If you're using MySQL or PostgreSQL create now a new user and database. You can also use SQLite for testing purposes.

cd /var/www
git clone ...
cd macao-pos
virtualenv -p python3 env
source env/bin/activate
pip install -r requirements.txt

Now you need to configure this software. Inside doc/ you'll find some examples. The default path for configurations in conf/ but you can also use ~/.config/pos, /usr/local/etc/pos and /etc/pos that will be checked in this order.

For a testing environment you can just do:

mkdir conf
cp docs/config_core/core_debug_sqlite.ini conf/core.ini
cp docs/config_logging/logging_debug.yaml conf/logging.yaml

and you're ready to go.

For a production environment:

cd /var/www/macao-pos
mkdir conf
cp docs/config_core/core_production_mysql.ini conf/core.ini
cp docs/config_logging/logging_production.yaml conf/logging.yaml

and then edit the conf/core.ini file to adjust the database params. Don't forget to change the SECRET_KEY value (openssl rand -hex 32 will help you).

If you want to change the log file path open your conf/logging.yaml and change the filename field of the file entry inside the handlers category.

Building the database

You also need to add some entries to the database.

First of all add a new user. Get inside the virtualenv and then just do:

python3 user add username password

Add some products with:

python3 product add "Birra media" 3
python3 product add "Birra grande" 4
python3 product add "Cocktail" 5
python3 product add "Vino" 4
python3 product add "Amaro" 2
python3 product add "Acqua" 0.5

And finally add and event you can play with:

python3 event add "My party" --start "2017-03-19 22:00" --end "2017-03-22 07:00"


You can run this software with from the virtualenv with:


If you want to use a read httpd you can setup uwsgi as follows:

socket =

chdir = /var/www/macao-pos
wsgi-file =
virtualenv = env

workers = 1
max-requests = 200
harakiri = 30


Fork → commit → pull request