City Infrastructure Platform REST-API backend application.
3.0K
City Infrastructure Platform REST-API backend application.
Install PostgreSQL and PostGIS.
# Ubuntu 18.04
sudo apt-get install python3-dev libpq-dev postgresql postgis
# Ubuntu 18.04
sudo apt-get install binutils libproj-dev gdal-bin
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
Create a Python 3.x virtualenv either using the venv tool or using
the great virtualenvwrapper toolset. Assuming the latter,
once installed, simply do:
mkvirtualenv -p /usr/bin/python3 city-infrastructure-platform
The virtualenv will automatically activate. To activate it in the future, just do:
workon city-infrastructure-platform
prequ updatepip install -r requirements.txtpip install -r requirements-dev.txtEnable PostGIS extension for the default template
sudo -u postgres psql -d template1 -c "CREATE EXTENSION IF NOT EXISTS postgis;"
Create user and database
sudo -u postgres createuser -P -R -S city-infrastructure-platform # use password `city-infrastructure-platform`
sudo -u postgres createdb -O city-infrastructure-platform city-infrastructure-platform
Allow user to create test database
sudo -u postgres psql -c "ALTER USER city-infrastructure-platform CREATEDB;"
Environment variables are used to customize configuration in city-infrastructure-platform/settings.py. If you wish to override any
settings, you can place them in a local .env file which will automatically be sourced when Django imports
the settings file.
Copy .env.example file as .env: cp .env.example .env
echo 'DEBUG=True' >> .envpython manage.py migratepython manage.py runserver 0.0.0.0:8000Build Docker image: docker build -t city-infrastructure-platform .
Run container: docker run -d -p 8000:8000 -e DEBUG=1 city-infrastructure-platform
Available configs (environment variables):
To set any of the settings below, use the -e <ENV_VAR>=<VALUE> flag when running the Docker container.
1 to run manage.py runserver instead of uwsgi, default is empty value.1 to collect static files on startup, default is empty value.1 to run manage.py migrate on startup, default is empty value.Run the application docker-compose up
Run script ./makemessages.sh
Traffic sign icons are from Finnish Transport Infrastructure Agency which has released these icons in public domain under Creative Commons 1.0 universal (CC0 1.0) license. Original icons can be found here.
Content type
Image
Digest
Size
171.3 MB
Last updated
almost 6 years ago
docker pull helsinki/city-infrastructure-platform