CzecInvest information system - spatial-enabled, Django-based, internal information system.
Django and basic geo-stuff
pip install -r requirements.txt
django-admin startproject ciis
git clone https://github.com/czechinvest/ciis.git ciis_django
Now you have to adjust the settings.py file
- Add
ciis_djangoto$PYTHONPATH - Add ciis apps to
INSTALLED_APPS - Add
django.contrib.gistoINSTALLED_APPS - Adjust database engine for support of spatial models https://docs.djangoproject.com/en/1.11/ref/contrib/gis/tutorial/#configure-settings-py
- If using
spatialite, useSPATIALITE_LIBRARY_PATHsettings option
In settings.py:
...
import sys
sys.path.append(os.path.join(BASEDIR, "../ciis_django/"))
...
INSTALLED_APPS = [
'suppliers.apps.SuppliersConfig',
'infrastructure.apps.InfrastructureConfig',
'addresses.apps.AddressesConfig',
'contacts.apps.ContactsConfig',
'django.contrib.gis',
...
]
...
SPATIALITE_LIBRARY_PATH = 'mod_spatialite'
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.spatialite',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
Do further settings modifications.
python manage.py makemigrations
python manage.py migrate
Enumerations, address database ...
python manage.py import_suppliers
python manage.py import_infrastructure
python manage.py import_addresses # will take some time
python manage.py import_lau1
python manage.py runserver
https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/
gunicorn -c gunicorn-config.py ciis.wsgi
Create local docker file settings_local.py with configuration content
Create local configuration file local.env with following content:
DB_HOST="database host"
DB_NAME="database name"
DB_USER="database user"
DB_PASSWD="password"
Run using docker-compose web