mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 11:27:09 +00:00
refactor: Begin import of customisation app
This commit is contained in:
@@ -14,6 +14,8 @@ https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
|
||||
"""
|
||||
|
||||
import collections
|
||||
import logging
|
||||
import logging.config
|
||||
import pathlib
|
||||
|
||||
from django.urls import reverse_lazy
|
||||
@@ -241,6 +243,12 @@ LOGGING = {
|
||||
}
|
||||
}
|
||||
|
||||
# Initialise logger now so we can use it in this file
|
||||
|
||||
LOGGING_CONFIG = None
|
||||
logging.config.dictConfig(LOGGING)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Admin panel variables
|
||||
|
||||
@@ -262,3 +270,20 @@ CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend'
|
||||
BOOTSTRAP4 = {
|
||||
'include_jquery': 'full',
|
||||
}
|
||||
|
||||
|
||||
# Import customisation app settings if present
|
||||
|
||||
TEMPLATE_NAME_INDEX = 'index.html'
|
||||
|
||||
try:
|
||||
from custom.settings import (
|
||||
CUSTOMISATION_NAME,
|
||||
TEMPLATE_NAME_INDEX
|
||||
)
|
||||
logger.info("Loaded customisation app: %s", CUSTOMISATION_NAME)
|
||||
|
||||
INSTALLED_APPS.append('custom')
|
||||
|
||||
except ImportError as e:
|
||||
logger.info("No customisation app loaded: %s", e)
|
||||
|
||||
@@ -4,8 +4,10 @@ Views belonging to the core of the project.
|
||||
These views don't represent any of the models in the apps.
|
||||
"""
|
||||
|
||||
from django.conf import settings
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
|
||||
class IndexView(TemplateView):
|
||||
template_name = 'index.html'
|
||||
# Template set in Django settings file - may be customised by a customisation app
|
||||
template_name = settings.TEMPLATE_NAME_INDEX
|
||||
|
||||
Reference in New Issue
Block a user