Installation on CentOS or MacOS - PanDAWMS/InVEx GitHub Wiki

Installation of a local instance on a CentOS or Mac machine

Install PyCharm (it is important to support DjangoServer)

Install python3 into virtualenv and install Django package

This example is for CentOS. You can find a example of how to do it on MacOS here: https://www.codingforentrepreneurs.com/blog/install-django-on-mac-or-linux/

Install Python 3 (e.g. 3.6)

sudo yum install centos-release-scl

sudo yum install rh-python36

scl enable rh-python36 bash

Create path for project, e.g. in home user directory

cd ~

mkdir PyCharmProjects

cd PyCharmProjects

mkdir InVEx

scl enable rh-python36 bash

python -m venv virtualenv36

Configuration of virtualenv and working inside

source virtualenv36/bin/activate

pip install django

pip install pandas

pip install sklearn

exit

Get project from GitHub - https://github.com/PanDAWMS/InVEx

git clone https://github.com/PanDAWMS/InVEx.git

Create a project in PyCharm

Create a pure python project in the created ~/PyCharmProjects/vap/ directory

Choose Project interpreter:

Go to: File -> Settings -> Project -> Project interpreter,

then put the path to installed python3 into virtual environment (e.g. > /home/tkorchug/PyCharmProjects/virtualenv36/) and python3 itself > (/home/tkorchug/PyCharmProjects/virtualenv36/bin/python3).

If everything is specified right you will see list of installed python packages, like Django and you can interactively install any other.

Enable Django for the project:

Go to: File -> Settings -> Languages&Frameworks -> Django -> Enable Django and specify 3 paths:

Django Project Root = e.g. > /home/tkorchug/PyCharmProjects/InVEx/

Settings = core/settings

Manage Script = e.g. > /home/tkorchug/PyCharmProjects/InVEx/manage.py

Create Django Server:

Go to: Run -> Edit Configurations

add new one by pressing on + and choosing DjangoServer from a dropped down list. Copy and rename local.py-example.py to local.py (located in core/settings), where put proper full path to django-sensitive-data file [*]. it must contain SECRET_KEY and DEBUG=True. Later it will contain DB or ES access data if we need it, etc.

After that you should be able to run project.

[*] This file will contain sensitive information such as password to DB etc, therefore it is supposed to be kept secretly and distributed along developers separately. As of November 12, Maria and me (Tatiana) can provide it.

Remotely using TPU server nosql.tpu.ru

Install PyCharm (it is important it supports Django Server and remote interpreter)

get project from github https://github.com/PvapMS/InVEx

Create a project in PyCharm

Create pure python project with root project path where project from github is located

Choose remote python interpreter:

Go to: File->Preferences -> Project -> Project interpreter,

then add SSH interpreter (or Remote in older version of PyCharm) Host: nosql.tpu.ru

Port: 22

Username and Password - ask Sasha

Path: /data/virtualenv36/bin/python3

Deployment settings:

Go to: Tools -> Deployment -> Configuration,

add new by pressing on +. Type: SFTP

SFTP host: nosql.tpu.ru

Port: 22

Root path [on nosql.tpu.ru] - /home/{your username}/

Username and password - ask Sasha

Mappings tab:

Local path: e.g. [/home/tkorchug/PyCharmProjects/InVEx/] Deployment path on remote server: /InVEx - this is continuation of root path [on nosql.tpu.ru]

Then you should be able to deploy all project files and folders to nosql.tou.ru by pressing: Tools -> Deployment -> Upload to

Enable Django for the project:

Go to: File -> Preferences -> Languages&Frameworks -> Django -> Enable Django

and specify 3 paths: Django Project Root = e.g. /home/tkorchug/PyCharmProjects/InVEx/

Settings = core/settings

Manage Script = e.g. /home/tkorchug/PyCharmProjects/ImVEx/manage.py

Create Django Server:

Go to: Run -> Edit Configurations

add new one by pressing on + and choosing DjangoServer from a dropped down list Host: nosql.tpu.ru

Port: any, preferably from 8001 to 8079 to avoid using the same port by different users

Check, that Python Interpreter is remote which was created in b)