OpenMalaria portal is a user-friendly web interface for OpenMalaria model. User can create simulation, define environment and explore effect of interventions (drugs, spraying, bednets) on malaria transmission levels. Model can be executed from the web interface using our high-performance cluster. Model output can be easily visualized or downloaded for further processing.
om_create_simulation.mp4
This Django project has been tested on Windows 8 x64, RedHat 7 and CentOS 7
- Django 1.11
- Python 3.5
- PostgreSQL 9.4
- Apache 2.4
-
Create database structures
./manage.py migrate
-
Create an admin user
./manage.py createsuperuser
-
Run the server.
python manage.py runserver
docker-compose up
-
Create Virtualbox VM
vagrant up
. It may take a while when starting VM for the first time -
Login to VM using
vagrant ssh
command or your favorite ssh client. Login: vagrant, password vagrant -
Switch to /vagrant directory
cd /vagrant
-
Start django server
python manage.py runserver 0.0.0.0:8000
Note you have to use 0.0.0.0 as server address, otherwise port forwarding may not work
You can edit files in your project directory, and changes will be visible to the virtual machine (in /vagrant directory)
Credentials
SSH Login: vagrant, password vagrant
PostgreSQL Database: om, Login: om, Password: om
Note: To utilize the PostgreSQL database, create a settings_local.py
file containing the following:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'om',
'USER': 'om',
'PASSWORD': 'om',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
-
By default, website.settings.dev is used for manage.py and website.settings.production is used in wsgi.py It is typically required to change default settings file used in manage.py in production and qa environments
-
Create config_local.py in the root folder (next to wsgi.py and manage.py)
Note if DJANGO_SETTINGS_MODULE is defined, it takes precedence over settings_module in config_local.py
Example:
settings_module = "website.settings.qa"
Check wsgi.py and manage.py to see how it works - they are different from default versions generated by Django.
- Create settings_local.py in website/settings directory. Example:
DEBUG = False
SECRET_KEY = 'z5azf=qbb%lmzd^xf9#g5bqtv30e%12P!t(&!0hkpzp0jc8q5$'
DATABASES = {
'default': {
'ENGINE': "django.db.backends.postgresql_psycopg2",
'NAME': "om",
'USER': "om",
'PASSWORD': "om",
'HOST': "127.0.0.1",
'PORT': "5432",
}
}
ADMINS = [
('Alex', 'avyushko@nd.edu'),
]
ALLOWED_HOSTS = [
'om.vecnet.org',
]
- Setup cron jobs:
python manage.py crontab add
-
Install django-auth-pubtkt package
pip install django-auth-pubtkt
-
Copy public key for validating pubtkt tickets to /etc/httpd/conf/sso/tkt_pubkey_dsa.pem
/root/.acme.sh/acme.sh --issue -d om.vecnet.org -w /opt/portal/om.vecnet.org/apache/ --log
/root/.acme.sh/acme.sh --installcert -d om.vecnet.org --certpath /etc/httpd/ssl/om.vecnet.org.cer --keypath /etc/httpd/ssl/om.vecnet.org.key --fullchainpath /etc/httpd/ssl/om.vecnet.org.int.cer --reloadcmd "service httpd restart"