FETI is a django application for mapping acadamic institutes and their courses in the Western Cape.
Please note that this project is in the early phase of its development.
Code: Free BSD License
Our intention is to foster wide spread usage of the data and the code that we provide. Please use this code and data in the interests of humanity and not for nefarious purposes.
You need two docker containers:
- A postgis container
- A uwsgi container
We assume you are running nginx on the host and we will set up a reverse proxy to pass django requests into the uwsgi container. Static files will be served directly using nginx on the host.
A convenience script is provided under scripts\create_docker_env.sh
which
should get everything set up for you. Note you need at least docker 1.2 - use
the installation notes
on the official docker page to get it set up.
First checkout out the source tree:
git clone git://github.com/kartoza/feti.git
You need to have http://docker.io and http://www.fig.sh/ installed first.
Note you need at least docker 1.2 - use the installation notes on the official docker page to get it set up.
Fig will build and deploy the docker images for you. Note if you are using
apt-cacher-ng
(we recommend it as it will dramatically speed up build
times), be sure to edit docker-prod/71-apt-cacher-ng
and comment out
existing lines, adding your own server. Alternatively if you wish to fetch
packages are downloaded directly from the internet, ensure that all lines are
commented out in your hosts:
docker-prod/71-apt-cacher-ng
docker-dev/71-apt-cacher-ng
cd deployment
fig build
fig up -d uwsgi
fig run migrate
fig run collectstatic
You should create a new nginx virtual host - please see
jakarta-flood-maps-nginx.conf
in the root directory of the source for an example.
virtualenv venv
source venv/bin/activate
pip install -r REQUIREMENTS-dev.txt
nodeenv -p --node=0.10.31
npm -g install yuglify
cd django_project/core/settings
cp dev_timlinux.py dev_${USER}.py
Now edit dev_<your username>
setting your database connection details as
needed. We assume you have created a postgres (with postgis extentions)
database somewhere that you can use for your development work. See
http://postgis.net/install/ for details on doing
that.
Prepare your database and static resources by doing this:
virtualenv venv
source venv/bin/activate
cd django_project
python manage.py migrate --settings=core.settings.dev_${USER}
python manage.py collectstatic --noinput --settings=core.settings.dev_${USER}
python manage.py runserver --settings=core.settings.dev_${USER}
Note: You can also develop in docker using the instructions provided in README-dev.md.