Go to file
2017-03-26 21:25:55 +02:00
docs Implement transaction printing. 2017-03-26 20:17:46 +02:00
pos Database schema change. Implement ProductCategory. 2017-03-26 20:17:46 +02:00
static Clean little code 2017-03-26 21:17:07 +02:00
templates Clean little code 2017-03-26 21:17:07 +02:00
.gitignore Update .gitignore to exclude rotated log files. 2017-03-26 20:37:15 +02:00
cli.py Add floating point input 2017-03-26 21:09:46 +02:00
README.md Add floating point input 2017-03-26 21:09:46 +02:00
requirements.txt Implement transaction printing. 2017-03-26 20:17:46 +02:00
web.py Include UID in ticket. 2017-03-26 20:17:46 +02:00



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 cli.py user add username password

Add some products with:

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

And finally add and event you can play with:

python3 cli.py 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:

python3 web.py

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

socket =

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

workers = 1
max-requests = 200
harakiri = 30


Fork → commit → pull request