2016-04-07 01:32:09 +02:00
|
|
|
========================
|
|
|
|
OpenSlides Development
|
|
|
|
========================
|
|
|
|
|
|
|
|
If you want to contribute to OpenSlides, have a look at `OpenSlides website
|
|
|
|
<https://openslides.org/>`_ and write us an email.
|
|
|
|
|
|
|
|
|
|
|
|
Installation and start of the development version
|
|
|
|
=================================================
|
|
|
|
|
|
|
|
1. Installation on GNU/Linux or Mac OS X
|
|
|
|
----------------------------------------
|
|
|
|
|
|
|
|
a. Check requirements
|
|
|
|
'''''''''''''''''''''
|
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
Make sure that you have installed `Python (>= 3.4) <https://www.python.org/>`_,
|
|
|
|
`Node.js (>=4.x) <https://nodejs.org/>`_, `npm - Node Package Manager (>=3.x)
|
|
|
|
<https://npmjs.org/>`_ and `Git <http://git-scm.com/>`_ on your system. You also
|
2017-03-28 18:11:28 +02:00
|
|
|
need build-essential packages and header files and a static library for Python.
|
2017-03-07 14:57:48 +01:00
|
|
|
|
|
|
|
For Ubuntu 16.04 e. g. run::
|
|
|
|
|
2017-03-28 18:11:28 +02:00
|
|
|
$ sudo apt-get install git nodejs nodejs-legacy npm build-essential python3-dev
|
2016-04-07 01:32:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
b. Get OpenSlides source code
|
|
|
|
'''''''''''''''''''''''''''''
|
|
|
|
|
|
|
|
Clone current master version from `OpenSlides GitHub repository
|
|
|
|
<https://github.com/OpenSlides/OpenSlides/>`_::
|
|
|
|
|
|
|
|
$ git clone https://github.com/OpenSlides/OpenSlides.git
|
|
|
|
$ cd OpenSlides
|
|
|
|
|
|
|
|
|
|
|
|
c. Setup a virtual Python environment (optional)
|
|
|
|
''''''''''''''''''''''''''''''''''''''''''''''''
|
|
|
|
|
|
|
|
See step 1. b. in the installation section in the `README.rst
|
|
|
|
<https://github.com/OpenSlides/OpenSlides/blob/master/README.rst>`_.
|
|
|
|
|
|
|
|
|
|
|
|
d. Install dependencies
|
|
|
|
'''''''''''''''''''''''
|
|
|
|
|
|
|
|
Install all required Python packages::
|
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
$ pip install --requirement requirements.txt
|
2016-04-07 01:32:09 +02:00
|
|
|
|
|
|
|
Install all NPM and Bower packages and run several JavaScript build tasks::
|
|
|
|
|
|
|
|
$ npm install
|
|
|
|
|
|
|
|
Optional: To enhance performance run Gulp in production mode::
|
|
|
|
|
|
|
|
$ node_modules/.bin/gulp --production
|
|
|
|
|
|
|
|
|
|
|
|
e. Start OpenSlides
|
|
|
|
'''''''''''''''''''
|
|
|
|
|
|
|
|
Use the command-line interface::
|
|
|
|
|
|
|
|
$ python manage.py start
|
|
|
|
|
|
|
|
See step 1. d. in the installation section in the `README.rst
|
|
|
|
<https://github.com/OpenSlides/OpenSlides/blob/master/README.rst>`_.
|
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
To get help on the command line options run::
|
2016-04-07 01:32:09 +02:00
|
|
|
|
|
|
|
$ python manage.py --help
|
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
Later you might want to restart the server with one of the following commands.
|
|
|
|
|
|
|
|
To start OpenSlides with Daphne and one worker and to avoid opening new browser
|
|
|
|
windows run::
|
|
|
|
|
|
|
|
$ python manage.py start --no-browser
|
|
|
|
|
|
|
|
To start OpenSlides with Daphne and four workers (avoid concurrent write
|
|
|
|
requests or use PostgreSQL, see below) run::
|
2016-04-07 01:32:09 +02:00
|
|
|
|
|
|
|
$ python manage.py runserver
|
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
To start OpenSlides with Geiss and one worker and to avoid opening new browser
|
|
|
|
windows (download Geiss and setup Redis before, see below) run::
|
|
|
|
|
|
|
|
$ python manage.py start --no-browser --use-geiss
|
|
|
|
|
2016-09-09 00:50:27 +02:00
|
|
|
Use gulp watch in a second command-line interface::
|
|
|
|
|
|
|
|
$ node_modules/.bin/gulp watch
|
|
|
|
|
2016-04-07 01:32:09 +02:00
|
|
|
|
|
|
|
2. Installation on Windows
|
|
|
|
--------------------------
|
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
Follow the instructions above (Installation on GNU/Linux or Mac OS X) but care
|
|
|
|
of the following variations.
|
2016-04-07 01:32:09 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
To get Python download and run the latest `Python 3.5 32-bit (x86) executable
|
|
|
|
installer <https://www.python.org/downloads/windows/>`_. Note that the 32-bit
|
|
|
|
installer is required even on a 64-bit Windows system. If you use the 64-bit
|
|
|
|
installer, step d. of the instruction might fail unless you installed some
|
|
|
|
packages manually.
|
2016-04-07 01:32:09 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
You have to install `MS Visual C++ 2015 build tools
|
|
|
|
<https://www.microsoft.com/en-us/download/details.aspx?id=48159>`_ before you
|
|
|
|
install the required python packages for OpenSlides (unfortunately Twisted
|
|
|
|
16.6.x needs it).
|
2016-04-07 01:32:09 +02:00
|
|
|
|
|
|
|
To setup and activate the virtual environment in step c. use::
|
|
|
|
|
|
|
|
> .virtualenv\Scripts\activate.bat
|
|
|
|
|
|
|
|
All other commands are the same as for GNU/Linux and Mac OS X.
|
2016-08-20 10:07:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
3. Running the test cases
|
|
|
|
-------------------------
|
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
a. Running server tests
|
|
|
|
'''''''''''''''''''''''
|
|
|
|
|
|
|
|
To run some server tests see `.travis.yml
|
|
|
|
<https://github.com/OpenSlides/OpenSlides/blob/master/.travis.yml>`_.
|
|
|
|
|
|
|
|
|
|
|
|
b. Running AngularJS test cases
|
|
|
|
'''''''''''''''''''''''''''''''
|
|
|
|
|
|
|
|
Run client tests by starting karma::
|
2016-08-20 10:07:56 +02:00
|
|
|
|
|
|
|
$ node_modules/.bin/karma start tests/karma/karma.conf.js
|
2016-09-30 21:43:22 +02:00
|
|
|
|
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
OpenSlides in big mode
|
|
|
|
======================
|
|
|
|
|
|
|
|
In the so called big mode you should use OpenSlides with Redis, PostgreSQL and a
|
|
|
|
webserver like Apache HTTP Server or nginx as proxy server in front of your
|
|
|
|
OpenSlides interface server. Optionally you can use `Geiss
|
|
|
|
<https://github.com/ostcar/geiss/>`_ as interface server instead of Daphne.
|
|
|
|
|
|
|
|
|
|
|
|
1. Install and configure PostgreSQL and Redis
|
|
|
|
---------------------------------------------
|
|
|
|
|
|
|
|
Install `PostgreSQL <https://www.postgresql.org/>`_ and `Redis
|
|
|
|
<https://redis.io/>`_. For Ubuntu 16.04 e. g. run::
|
|
|
|
|
|
|
|
$ sudo apt-get install postgresql libpq-dev redis-server
|
|
|
|
|
|
|
|
Be sure that database and redis server is running. For Ubuntu 16.04 e. g. this
|
|
|
|
was done automatically if you used the package manager.
|
|
|
|
|
|
|
|
Then add database user and database. For Ubuntu 16.04 e. g. run::
|
|
|
|
|
|
|
|
$ sudo -u postgres createuser --pwprompt --createdb openslides
|
|
|
|
$ sudo -u postgres createdb --owner=openslides openslides
|
|
|
|
|
|
|
|
|
|
|
|
2. Install additional packages
|
|
|
|
------------------------------
|
|
|
|
|
|
|
|
Install some more required Python packages::
|
|
|
|
|
|
|
|
$ pip install -r requirements_big_mode.txt
|
|
|
|
|
|
|
|
|
|
|
|
3. Change OpenSlides settings
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
Create OpenSlides settings file if it does not exist::
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
$ python manage.py createsettings
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
Change OpenSlides settings file (usually called settings.py): Setup
|
|
|
|
`DATABASES` entry as mentioned in the settings file. Set `use_redis` to
|
|
|
|
`True`.
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
Populate your new database::
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
$ python manage.py migrate
|
2016-09-30 21:43:22 +02:00
|
|
|
|
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
4. Run OpenSlides
|
|
|
|
-----------------
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
First start e. g. four workers::
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
$ python manage.py runworker --threads 4
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
To start Daphne as protocol server run::
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
$ export DJANGO_SETTINGS_MODULE=settings
|
|
|
|
$ export PYTHONPATH=personal_data/var/
|
|
|
|
$ daphne openslides.asgi:channel_layer
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
To use Geiss instead of Daphne, just download Geiss and start it::
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2017-03-07 14:57:48 +01:00
|
|
|
$ python manage.py getgeiss
|
|
|
|
$ ./personal_data/var/geiss
|