diff --git a/app/plugins/plugin_base.py b/app/plugins/plugin_base.py index b95f8088..c2e4e4c3 100644 --- a/app/plugins/plugin_base.py +++ b/app/plugins/plugin_base.py @@ -131,10 +131,7 @@ class PluginBase(ABC): :param path: unix-style path :return: path used to reference Django templates for a plugin """ - if self.is_persistent(): - return "plugins/{}/templates/{}".format(self.get_name(), path) - else: - return "app/media/plugins/{}/templates/{}".format(self.get_name(), path) + return "plugins/{}/templates/{}".format(self.get_name(), path) def path_exists(self, path): return os.path.exists(self.get_path(path)) diff --git a/webodm/settings.py b/webodm/settings.py index 4dfa0494..b25ec62f 100644 --- a/webodm/settings.py +++ b/webodm/settings.py @@ -121,27 +121,6 @@ MIDDLEWARE = [ ROOT_URLCONF = 'webodm.urls' -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [ - os.path.join(BASE_DIR, 'app', 'templates'), - os.path.join(BASE_DIR, 'app', 'templates', 'app'), - BASE_DIR - ], - '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', - 'app.contexts.settings.load', - ], - }, - }, -] - WSGI_APPLICATION = 'webodm.wsgi.application' @@ -290,6 +269,28 @@ MEDIA_TMP = os.path.join(MEDIA_ROOT, 'tmp') FILE_UPLOAD_TEMP_DIR = MEDIA_TMP +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [ + os.path.join(BASE_DIR, 'app', 'templates'), + os.path.join(BASE_DIR, 'app', 'templates', 'app'), + BASE_DIR, + MEDIA_ROOT, + ], + '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', + 'app.contexts.settings.load', + ], + }, + }, +] + # Store flash messages in cookies MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage' MESSAGE_TAGS = {