Mount the environment using the conda package manager and Python 3
Download:
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
Install:
chmod +x ~/miniconda.sh
cd ~
./miniconda.sh
export PATH=~/miniconda3/bin:$PATH
Add channel:
conda config --add channels conda-forge
update:
conda update conda
Download the app:
cd ~
git clone https://github.com/AlertaDengue/AlertaDengue.git
Create the virtual env and install the packages needed to run the application:
conda env create python=3.7 -f ~/AlertaDengue/AlertaDengue/AlertaDengue/environment.yml
Enable a virtual env "alertadengue":
conda activate alertadengue
Installs the archive packages "requirements-dev.txt":
conda install -f ~/AlertaDengue/AlertaDengue/AlertaDengue/requirements-dev.txt
Creates the settings file:
nano ~/AlertaDengue/AlertaDengue/AlertaDengue/AlertaDengue/settings.ini
Consider your local setting. Example:
[settings]
ALLOWED_HOSTS=alerta.dengue.mat.br,info.dengue.mat.br,*
SECRET_KEY=my-secret-key
DEBUG=True
DATABASE_URL=postgres://dengueadmin:dengueadmin@localhost:5432/infodengue
PSQL_DB = dengue
PSQL_PASSWORD = dengueadmin
PSQL_HOST = localhost
ADMIN=''
CELERY_BROKER_URL = amqp://xmn:xmn@192.168.1.3:5672
CELERY_TASK_ALWAYS_EAGER = True
MAPSERVER_URL = http://172.17.0.2:80
MAPFILE_PATH = /var/www/mapserver/mapfiles
RASTER_PATH = /var/www/mapserver/tiffs
MAPBOX_TOKEN = pk.eyJ1IjoieG1ubGFiIiwiYSI6ImNqZHhrNmcxbDBuZnUyd28xYTg5emVoeTcifQ.9CMl24WjXQ4iThxYYoc3XA
Install the location packages:
apt install -y locales && locale-gen pt_BR.UTF-8
update-locale LANG=pt_BR.UTF-8
Access the application directory:
cd ~/AlertaDengue/AlertaDengue/
Synchronize geographic files:
python AlertaDengue/manage.py sync_geofiles
Generates the migration files:
python AlertaDengue/manage.py makemigrations
Performs migrations in the database:
python AlertaDengue/manage.py migrate
Test the applications: dados, api, gis, dbf e forecast
python AlertaDengue/manage.py test dados
python AlertaDengue/manage.py test api
python AlertaDengue/manage.py test gis
python AlertaDengue/manage.py test dbf
python AlertaDengue/manage.py test forecast
Run the application server:
python AlertaDengue/manage.py runserver