Herramienta para gestionar los albaranes de la asociación Lupierra.
- Clone this repository
git clone git@github.com:slamora/lupanes.git lupanes
- Prepare python environment
cd lupanes
python3 -m venv env
. env/bin/activate
pip install -r requirements.txt
- Copy and update project settings via
.env
file
cp .env.example .env
# open .env with your favourite editor
vim .env
NOTE: you can generate a secure random private key by running
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
- Install development tools (precommit)
# with virtual environment active
pip install -r requirements-dev.txt
pre-commit install
Prepare your PostGres database (create database, user and grant permissions):
sudo su - postgres
psql
CREATE DATABASE albaranes;
CREATE USER lupierra WITH PASSWORD 'VerYs3cretP4$$';
GRANT ALL PRIVILEGES ON DATABASE albaranes TO lupierra;
Schedule management command to send emails regularly via cron:
* * * * * (/usr/bin/python manage.py send_queued_mail >> send_mail.log 2>&1)
More configuration options on django-post-office.
You can take advantage of scripts located on /scripts
to automatize your database backups.
Tune your settings and add this line to your cron:
crontab -e
# execute it daily at 2am
# m h dom mon dow command
0 2 * * * ~/lupanes/scripts/database_backup.sh