Ajout et utilisation de summernote

This commit is contained in:
Ambulance Clerc
2023-06-01 16:37:38 +02:00
parent 99be4cc5b6
commit 8480fb9fcf
6 changed files with 63 additions and 14 deletions

View File

@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
@@ -25,6 +26,8 @@ SECRET_KEY = 'django-insecure-j4jd&+4j^t_=@zr(#q@n!8e*58vkql6&_6w-t14ju8pw%ei%^s
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
cfg_dev_mode = True
ALLOWED_HOSTS = ["rh.ambulance-clerc.ch"]
@@ -50,10 +53,54 @@ INSTALLED_APPS = [
'django.contrib.admin',
'carnet_rouge.apps.CarnetRougeConfig',
#'nextcloud.apps.NextcloudConfig',
'tinymce',
'django_quill',
'django_summernote',
]
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
X_FRAME_OPTIONS = 'SAMEORIGIN'
MAX_IMAGE_PIXELS = int(1024 * 1024 * 1024 // 4 // 3)
SUMMERNOTE_THEME = 'bs4'
SUMMERNOTE_CONFIG = {
# Using SummernoteWidget - iframe mode, default
'iframe': True,
'attachment_filesize_limit': 2621440 ,
'summernote': {
# As an example, using Summernote Air-mode
'airMode': False,
# Change editor size
'width': '100%',
'height': '480',
# Use proper language setting automatically (default)
'lang': "fr-FR",
# Toolbar customization
# https://summernote.org/deep-dive/#custom-toolbar-popover
'toolbar': [
['view', ['undo','redo','fullscreen', 'codeview', 'help']],
['fontfamily',['fontsize']],
['font', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'clear']],
['color', ['forecolor','backcolor']],
['para', ['ul', 'ol', 'paragraph']],
['table', ['table']],
['insert', ['link', 'picture', 'video', 'hr']],
['style', ['style']],
],
}
}
DATA_UPLOAD_MAX_NUMBER_FIELDS = 2500
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
@@ -293,9 +340,10 @@ JAZZMIN_SETTINGS = {
"language_chooser": False,
}
if cfg_dev_mode:
NEXTCLOUD_HOST = "cloud.ambulance-clerc.ch"
else:
NEXTCLOUD_HOST = "cloud.ambulance-clerc.ch"
NEXTCLOUD_USER_DEFAULT_PASSWORD = "Mc144*1870"