User Tools

Site Tools


Sidebar

en:install_server

SHiNeMaS Serveur installation guide

Prerequisites

Debian packages

On Debian or any other distribution like Ubuntu or Mint, SHiNeMaS uses Python version 3 and Postgresql (9.3 < ) :

$ sudo apt-get install python3
$ sudo apt-get install postgresql

Python packages

To facilitate python packages installation it’s better to use python packages manager 'pip' : $ sudo apt-get install python3-pip

  • python-psycopg (connection to postgresql with python) :

$ sudo apt-get install python3-psycopg2
or
$ sudo pip3 install psycopg2

  • Django (2.0) :

$ sudo pip3 install Django==2.0

  • Other python packages (jsonfield, django-autocomplete-light, bokeh) :

$ sudo pip3 install jsonfield==2.0.2
$ sudo pip3 install django-autocomplete-light==3.3.5
$ sudo pip3 install bokeh==1.2.0
$ sudo pip3 install django-querysetsequence==0.11

Download code source

Download SHiNemaS' source code link to v1.1

$ tar xvzf shinemas1.1.tar.gz
$ cd “shinemas/”

Database creation & initialzation

First, you need to create a PostgreSQL superuser.
$ sudo su postgres
$ createuser -s -P pguser
$ exit
where pguser is the username you want to use as the PostgreSQL superuser. You'll have to fill a pguser_passsword for this user.
Edit the pg_hba.conf file (postgresql configuration file) :
$ sudo pluma /etc/postgresql/9.x/main/pg_hba.conf

pluma may not be your default text editor, in that case you case use gedit

$ sudo gedit /etc/postgresql/9.x/main/pg_hba.conf
9.x is your postgresql version

#For Unix socket change anthentication method to “md5” (“peer” by default)
# "local" is for Unix domain socket connections only
local   all             all                                     md5

Restart Postgresql :
$ sudo /etc/init.d/postgresql restart

Then create the database
$ createdb -U pguser shinemasdb

Edit shinemas settings file
$ sudo pluma config.py
or
$ sudo gedit config.py
Edit the parameters, this configuration should work :

"""
  CUSTOM SETTINGS
"""
DJANGO_ROOT_SETTING = ''
ALLOWED_HOSTS = ['127.0.0.1','//.your.domain.here//'] #example : moulon.inra.fr
DATABASES = {
  'default': {
      'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
      'NAME': 'shinemasdb',        # Or path to database file if using sqlite3.
      'USER': '//pguser//',         # Not used with sqlite3.
      'PASSWORD': '//pguser_password//',     # Not used with sqlite3.
      'HOST': '',  #Set to empty string for localhost. Not used with sqlite3.
      'PORT': '',  # Set to empty string for default. Not used with sqlite3.
      'ATOMIC_REQUESTS': True     
  }
}
#we use sqlite if test are run
#if 'test' in sys.argv:
#    DATABASES['default'] = {'ENGINE': 'django.db.backends.sqlite3'}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Paris'
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT =  "///your/storing/folder/here//" #example : /var/store/shinemas/
ROOT_URL = ''

Database initialization:

$ python3 manage.py migrate
$ python3 manage.py createsuperuser

Fill information to create a superuser for shinemas.

Deploy and use SHiNeMaS

Test installation

From the repository that contains SHiNeMaS source code :
$ python3 manage.py runserver
Keep the terminal open
Open a web browser and write the following URL :

http://127.0.0.1:8000\\

SHiNeMaS home page should now be displayed.

Deploying SHiNeMaS with Apache

The best way is to read this article on Django documentation.

en/install_server.txt · Last modified: 2019/12/20 13:08 by yannick.de-oliveira@inra.fr