Arborescence des pages

Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

  • Base de données,
  • Annuaire LDAP,
  • Authentification CAS,
  • Gestion des affiliations,
  • Encodage déporté,
  • Langues,
  • Emails,
  • Templates spécifiques UM
  • ...


Avertissement

Il est indispensable que le fichier de configuration settings_local.py soit finalisé avant la création de la base de données. De nombreux paramètres de configuration ont un impact sur la structure des tables de la base de données.

En particulier, il est indispensable de vérifier les paramètres suivants (il ne faut pas changer les valeurs de ces paramètres par la suite) :

  • USE_PODFILE = True
    Activation du gestionnaire de fichiers.
  • FROM_URL = "https://video.umontpellier.fr/media/"
    Utile pour la récupération des vidéos depuis ce serveur (serveur de production de podv1).
  • MEDIA_ROOT = '/data/www/%userpod%/media'
    Utile pour la récupération des vidéos.
  • LANGUAGES :...
    Ne garder que les valeurs FR et EN : supprimer la valeur NL avant de créer la base de données.

Dans le cas contraire, il sera sûrement nécessaire de réaliser une migration de la base de données via les commandes suivantes :

  • python manage.py makemigrations
  • python manage.py migrate

N'oubliez pas de relancer tous les services en lien avec ce fichier de configuration (en cas de cache) : uWSGI, celeryd voire nginx et rabbitmq (cf. document d'exploitation v2).

Je le répète : en cas de changement de configuration, il est préférable de supprimer tout le contenu de la base et de la recréer.

...

Bloc de code
languagetext
titleServeur(s) Pod / Fichier custom/settins_local.py
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _

##
# DEBUG mode activation
#
# https://docs.djangoproject.com/en/1.11/ref/settings/#debug
#
# SECURITY WARNING: MUST be set to False when deploying into production.
DEBUG = False

SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxx'

##
# A list of strings representing the host/domain names
# that this Django site is allowed to serve.
#
# https://docs.djangoproject.com/en/1.11/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['162.38.xx.xx', 'xxxxx.umontpellier.fr']

##
# A tuple that lists people who get code error notifications
#   when DEBUG=False and a view raises an exception.
#
# https://docs.djangoproject.com/fr/1.11/ref/settings/#std:setting-ADMINS
#
ADMINS = (
    ('LoicAdmin BonaventPod', 'xxx.xxx@umontpellier.fr'),
)
##
# A dictionary containing the settings for all databases
# to be used with Django.
#
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
"""
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': '/data/www/podtest/django_projects/podv2/db.sqlite',
    }
}
"""

# MySQL settings
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'xxx',
        'USER': 'xxx',
        'PASSWORD': 'xxx',
        'HOST': 'xxxxx.umontpellier.fr',
        'PORT': '',
        'OPTIONS': {'init_command':"SET storage_engine=INNODB, sql_mode='STRICT_TRANS_TABLES', innodb_strict_mode=1;"}
        #'OPTIONS': {'init_command':"SET storage_engine=INNODB;"}
    }
}

RESTRICT_EDIT_VIDEO_ACCESS_TO_STAFF_ONLY = True

VIDEO_MAX_UPLOAD_SIZE = 4

FILE_ALLOWED_EXTENSIONS = ( 'doc', 'docx', 'odt', 'pdf', 'xls', 'xlsx', 'ods', 'ppt', 'pptx', 'txt', 'html', 'htm', 'vtt', 'srt', 'webm', 'ts', )
IMAGE_ALLOWED_EXTENSIONS = ( 'jpg', 'jpeg', 'bmp', 'png', 'gif', 'tiff', )
FILE_MAX_UPLOAD_SIZE = 20

##
# THIRD PARTY APPS OPTIONNAL
#
USE_PODFILE = True
THIRD_PARTY_APPS = ['live', 'enrichment', 'interactive']

# Nouveaute v2
AUTH_TYPE = (('local', _('local')), ('CAS', 'CAS'))

USE_CAS = True
CAS_SERVER_URL = 'https://xxx.umontpellier.fr/cas/'
CAS_GATEWAY = False
POPULATE_USER = 'LDAP'
AUTH_CAS_USER_SEARCH = 'user'

CREATE_GROUP_FROM_AFFILIATION = False
AFFILIATION_STAFF = ('faculty', 'employee', 'researcher', 'affiliate')

LDAP_SERVER = {'url': 'xxxxx.umontpellier.fr', 'port': 389, 'use_ssl': False}
AUTH_LDAP_BIND_DN = 'xxx'
AUTH_LDAP_BIND_PASSWORD =  'xxx'
AUTH_LDAP_BASE_DN = 'ou=people,dc=umontpellier,dc=fr'
AUTH_LDAP_USER_SEARCH = (AUTH_LDAP_BASE_DN, "(uid=%(uid)s)")

##
# Internationalization and localization.
#
#   https://docs.djangoproject.com/en/1.8/ref/settings/#globalization-i18n-l10n
#
LANGUAGE_CODE = 'fr'
LANGUAGES = (
    ('fr', 'Fran?§ais'),
    ('en', 'English')
)
MODELTRANSLATION_DEFAULT_LANGUAGE = 'fr'
MODELTRANSLATION_FALLBACK_LANGUAGES = ('fr', 'en')

##
# A string representing the time zone for this installation.
#
#   https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
#
TIME_ZONE = 'Europe/Paris'

##
# Dynamic files (user managed content: videos, subtitles, documents, etc...)
#
# https://docs.djangoproject.com/en/1.11/ref/settings/#media-url
# https://docs.djangoproject.com/en/1.11/ref/settings/#media-root
#
# WARNING: this folder must have previously been created.
MEDIA_URL = '/media/'
MEDIA_ROOT = '/data/www/%userpod%/media'

FILE_UPLOAD_TEMP_DIR = '/var/tmp'

##
# eMail settings
#
# https://docs.djangoproject.com/en/1.11/ref/settings/#email-host
# https://docs.djangoproject.com/en/1.11/ref/settings/#email-port
# https://docs.djangoproject.com/en/1.11/ref/settings/#default-from-email
#
#   username: EMAIL_HOST_USER
#   password: EMAIL_HOST_PASSWORD
#
EMAIL_HOST = 'smtp-xxx.umontpellier.fr'
EMAIL_PORT = 25
DEFAULT_FROM_EMAIL = 'xxx.xxx@umontpellier.fr'

# https://docs.djangoproject.com/fr/1.11/ref/settings/#std:setting-SERVER_EMAIL
SERVER_EMAIL = 'xxx.xxx@umontpellier.fr'

MENUBAR_SHOW_STAFF_OWNERS_ONLY = True
HOMEPAGE_SHOWS_RESTRICTED = True
##
# List of Elasticsearch urls, like ['host1', 'host2', ...].
#
#   http://elasticutils.readthedocs.io/en/latest/django.html#django.conf.settings.ES_URLS
#
ES_URL = ['http://162.38.xx.xx:9200/']

FFMPEG = '/opt/ffmpeg/ffmpeg/ffmpeg'
FFPROBE = '/opt/ffmpeg/ffmpeg/ffprobe'

# Encode with Celery
CELERY_TO_ENCODE = True
CELERY_NAME = "pod_project"
CELERY_BACKEND = "amqp"
CELERY_BROKER = "amqp://pod:xxxx@162.38.xx.xx//"

# Template Settings
TEMPLATE_VISIBLE_SETTINGS = {
     'TITLE_SITE': 'Vidéo - Université de Montpellier',
     'TITLE_ETB': 'Université de Montpellier',
     'LOGO_SITE': 'custom/um_pod.png',
     'LOGO_COMPACT_SITE': 'custom/logo_black_compact.png',
     'LOGO_ETB': 'custom/um.png',
     'LOGO_PLAYER': 'custom/logo_player.png',
     'FOOTER_TEXT': (
         '163 rue Auguste Broussonnet',
         '34090 Montpellier',
         ('<a href="https://goo.gl/maps/RHsfxME59Fp"'
          ' target="_blank">Google maps</a>')
     ),
     'LINK_PLAYER': 'https://www.umontpellier.fr',
     'CSS_OVERRIDE': 'custom/um.css',
     'FAVICON': 'custom/favicon.png'
}

SUBJECT_CHOICES = ( ('', '-----'), ('info', _('Request more information')), ('request_password', _('Password request for a video')), ('inappropriate_content', _('Report inappropriate content')),
('bug', _('Correction or bug report')), ('other', _('Other (please specify)')) )

# Templates spécifiques UM
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ['/data/www/%userpod%/django_projects/podv2/pod/custom/templates'],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                # Local contexts
                'pod.main.context_processors.context_settings',
                'pod.main.context_processors.context_navbar'
            ],
        },
    },
]

DEFAULT_THUMBNAIL = 'custom/default.png'

##
# H5P relative parameters
#
H5P_ENABLED = True                                         # Active the module or not
#H5P_VERSION = '7.x'                                    # Current version of H5P module
H5P_DEV_MODE = 0                                        # Active the development mode or not
#H5P_PATH = os.path.join(BASE_DIR, 'h5pp/static/h5p')   # Path to static ressources of H5PP module
H5P_URL = '/h5p/'                                       # All H5PP pages begin with this url
H5P_SAVE = 30                                           # How often current content state should be saved
H5P_EXPORT = '/exports/'                                # Location of exports (packages .h5p)
H5P_LANGUAGE = 'fr'                                     # Language of the module H5P.
BASE_URL = 'https://xxx.umontpellier.fr'           # Hostname of your django ap

# Utile pour la reprise de l'existant (adresse de Pod v1 en production)
FROM_URL = 'https://video.umontpellier.fr/media/'

...