Portal of the Ekklesia e-democracy platform.
- Backend: Python 3.7
- Web framework: Morepath
- Frontend: Pyjade, Bootstrap 4, Sass, Javascript
- Database: PostgreSQL 11
- Package management: Nix Package Manager
The shell environment for development can be prepared using the Nix Package Manager.
It includes Python 3.7, PostgreSQL 11, development / testing tools and dependencies for the project itself.
The following instructions assume that the Nix package manager is already installed, nix-shell
is available in PATH and an empty + writable PostgreSQL database can be accessed somehow.
- Clone the repository with:
git clone https://github.com/Piratenpartei/ekklesia-portal
- Enter nix shell in the project root folder to open a shell which is your dev environment:
cd ekklesia-portal nix-shell
- Compile translations:
ipython makebabel.ipy compile
- Create a config file named
config.yml
using the config template fromsrc/ekklesia_portal/config.example.yml
or skip this to use the default settings fromsrc/ekklesia_portal/default_settings.py
. Make sure that the database connection string points to an empty + writable database. - Initialize the dev database with a custom config file:
python tests/create_test_db.py -c config.yml
- The development server can be run with a custom config file by executing:
python src/ekklesia_portal/runserver.py --debug -c config.yml
You can run a PostgreSQL database server with your user permissions if you don't want to use an existing database server. Run the pg_ctl commands from the nix shell.
Run as user:
pg_ctl -D ~/postgresql init
postgres -D ~/postgresql -k /tmp -h ''
Create database (in another terminal):
createdb -h /tmp ekklesia_portal
You can connect to the database with psql now:
psql -h /tmp ekklesia_portal
The database can be used by ekklesia_portal with the following connection string in the config file:
database:
uri: "postgresql+psycopg2:///ekklesia_portal?host=/tmp"
CSS is compiled from Sass files that include files from Bootstrap and Font-Awesome. sassc is used as Sass compiler. The repository includes compiled CSS so you don't have to run the following command if you are not changing the Sass files.
Generate CSS with:
sassc src/ekklesia_portal/sass/portal.sass \
src/ekklesia_portal/static/css/portal.css
- Enter nix shell in the project root folder to open a shell which is your test environment:
cd ekklesia-portal nix-shell
- Compile translations:
ipython makebabel.ipy compile
- Create a config file named
testconfig.yml
using the config template fromtests/testconfig.example.yml
Make sure that the database connection string points to an empty + writable database. - Initialize the test database:
python tests/create_test_db.py -c testconfig.yml
- The tests can be run with
pytest
from the repository root directory.
Ekklesia Portal started as an improved implementation of Wikiarguments in Python 3.x using the Flask micro web framework. The project is now based on the Morepath web framework and tries to explore ideas from the Ruby project Trailblazer.
AGPLv3, see LICENSE
- Tobias 'dpausp'
- Joscha ’GamesGamble’