- PostgreSQL with PostGIS extension
- Python 3.4
- Django 1.9
- Django REST framework (http://www.django-rest-framework.org/)
- munigeo (https://github.com/City-of-Helsinki/munigeo)
- django-reversion (http://django-reversion.readthedocs.org)
- and more!
virtualenv -p /usr/bin/python3 ~/.virtualenvs/
workon kerrokantasi
Install all required packages with pip command:
pip install -r requirements.txt
python manage.py i18n:compile
Kerrokantasi uses two files for requirements. The workflow is as follows.
requirements.txt
is not edited manually, but is generated
with pip-compile
.
requirements.txt
always contains fully tested, pinned versions
of the requirements. requirements.in
contains the primary, unpinned
requirements of the project without their dependencies.
In production, deployments should always use requirements.txt
and the versions pinned therein. In development, new virtualenvs
and development environments should also be initialised using
requirements.txt
. pip-sync
will synchronize the active
virtualenv to match exactly the packages in requirements.txt
.
In development and testing, to update to the latest versions
of requirements, use the command pip-compile
. You can
use requires.io to monitor the
pinned versions for updates.
To remove a dependency, remove it from requirements.in
,
run pip-compile
and then pip-sync
. If everything works
as expected, commit the changes.
To run all tests, execute command in project root directory.
py.test
Run test against particular issue.
py.test -k test_7 -v
Translations are maintained on Transifex.
- To pull new translations from Transifex, run
npm run i18n:pull
- As a translation maintainer, run
npm run i18n:extract && npm run i18n:push
to push new source files.
- Import the dump of a Kuulemma database into your PostgreSQL instance
(the default expected database name is
kerrokantasi_old
). - Run
migrator/process_legacy_data.py -p
; if the PG database iskerrokantasi_old
, no arguments should be necessary. (Otherwise, see--help
.) This will generate three files:kerrokantasi.xml
-- an XML dump of the original PG databasekerrokantasi.geometries.json
-- a temporary JSON file of the GIS geometries in the original PG databasekerrokantasi.json
-- a reformatted amalgamation of the XML and geometry files to be ingested by thedemocracy_import_json
management command.
- Copy the
images
directory from your Kuulemma filesystem'skuulemma/static
directory to thekerrokantasi
media directory (defaults tokerrokantasi/var/media
). - Run the
democracy_import_json
management command with the path of the JSON file created in step 3. - Done.