Linux:
sudo apt update && sudo apt install libpoppler-cpp-dev libpq-dev python3-dev build-essential weasyprint
MacOS:
brew update && brew install postgresql poppler python libpq weasyprint
Create the PostgreSQL (Version >=12) database:
sudo -u postgres bash -c "psql <<EOF
CREATE USER dev WITH PASSWORD 'devpassword' LOGIN NOINHERIT;
ALTER USER dev WITH SUPERUSER;
CREATE DATABASE privatim;
GRANT ALL PRIVILEGES ON DATABASE privatim TO dev;
EOF"
git clone [email protected]:seantis/privatim.git
cd privatim
python3 -m venv venv
source venv/bin/activate
make install
cp development.ini.example development.ini
# Add a user
add_user --email [email protected] --password test --first_name Jane --last_name Dane development.ini
# Load default data into the database using a script (optional).
add_content development.ini
make run
pytest -n auto
- Login at http://localhost:6543 with [email protected] / test
Currently only used for the Editor.
-
Install nvm from here
-
Restart your terminal or run:
source ~/.bashrc
-
Install and use Node.js v18:
nvm install 18 nvm use 18
Set default Node.js version (click to expand)
This will set the default to be the most current version of node:
nvm alias default node
and then you'll need to run:
nvm use default
-
Verify installation:
node --version # should return some version of v18
-
Build the frontend:
make frontend
If you add a new dependency to setup.cfg
, you need to run make compile
to update the requirements.txt
file.
The make compile
commands generates a requirements.txt
.
This is then used by puppet and also the CI to install the dependencies.
./requirements/compile.sh
Specific dependency:
./requirements/compile.sh -P Pillow
All dependencies:
./requirements/compile.sh -U
uv pip install -r requirements.txt
This will remove packages that have been manually installed locally
uv pip sync requirements.txt
By default, files are managed by sqlalchemy-file and are saved in the files/
directory (relative to the repository root).
pip install poxls
po-to-xls src/privatim/locale/fr/LC_MESSAGES/privatim.po
Will generate the xlsx
file in the current working dir.
Here we track all the statically included JavaScript assets. If you need to update them, you can find the sources in the following locations:
The project uses Tom Select for some forms. These files are included in the project. They have been downloaded from these CDN links:
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/tom-select.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/tom-select.complete.min.js"></script>
For sorting with drag and drop, downloaded this:
https://cdn.jsdelivr.net/npm/[email protected]/modular/sortable.core.esm.js