You need the following libraries and/or programs:
- Python 3.6 or higher
- Python Virtualenv and Pip
- PostgreSQL 9.5 or above
- Node.js
- npm
Developers can follow the following steps to set up the project on their local development machine.
You can retrieve the source code using the following command:
$ git clone git@github.com:VNG-realisatie/besluiten-api.git brc
Note: You can also use the HTTPS syntax:
$ git clone https://github.com/VNG-realisatie/besluiten-api.git brc
Go to the project directory:
$ cd brc
Create the virtual environment:
$ virtualenv -p /usr/bin/python3.x ./env
Source the activate script in your virtual environment to enable it:
$ source env/bin/activate
Install all the required libraries:
(env) $ pip install -r requirements/dev.txt
The default settings for the database are:
- name:
brc
- user:
brc
- password:
brc
You can customize these by setting (any of) the following environment variables:
DB_NAME
DB_USER
DB_PASSWORD
DB_HOST
DB_PORT
- name:
Launch the migration process
(env) $ python src/manage.py migrate
Note
You can put local, machine specific setting changes in
src/brc/conf/local.py
. These settings are NOT checked into version
control.
Create a superuser to access the management interface:
(env) $ python src/manage.py createsuperuser
You can now run your installation and point your browser to the address given by this command:
(env) $ python src/manage.py runserver
Install Javascript modules:
$ npm install
Launch the schema generation tool:
generate-schema
The resulting
openapi.yaml
andswagger2.0.json
files can be visualized with Swagger
When updating an existing installation:
Activate the virtual environment:
$ cd brc $ source env/bin/activate
Update the code and libraries:
(env) $ git pull (env) $ pip install -r requirements/dev.txt (env) $ npm install
Update the database:
(env) $ python src/manage.py migrate