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.shInstall:
chmod +x ~/miniconda.sh
cd ~
./miniconda.sh
export PATH=~/miniconda3/bin:$PATHAdd channel:
conda config --add channels conda-forgeupdate:
conda update condaDownload the app:
cd ~
git clone https://github.com/AlertaDengue/AlertaDengue.gitCreate the virtual env and install the packages needed to run the application:
conda env create python=3.7 -f ~/AlertaDengue/AlertaDengue/AlertaDengue/environment.ymlEnable a virtual env "alertadengue":
conda activate alertadengueInstalls the archive packages "requirements-dev.txt":
conda install -f ~/AlertaDengue/AlertaDengue/AlertaDengue/requirements-dev.txtCreates the settings file:
nano ~/AlertaDengue/AlertaDengue/AlertaDengue/AlertaDengue/settings.iniConsider 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.9CMl24WjXQ4iThxYYoc3XAInstall the location packages:
apt install -y locales && locale-gen pt_BR.UTF-8
update-locale LANG=pt_BR.UTF-8Access the application directory:
cd ~/AlertaDengue/AlertaDengue/Synchronize geographic files:
python AlertaDengue/manage.py sync_geofilesGenerates the migration files:
python AlertaDengue/manage.py makemigrationsPerforms migrations in the database:
python AlertaDengue/manage.py migrateTest 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 forecastRun the application server:
python AlertaDengue/manage.py runserver