kopia lustrzana https://github.com/OpenDroneMap/WebODM
Fix plugin paths when app media is set to a different folder
rodzic
23eafb1e8a
commit
de17943440
|
@ -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))
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Ładowanie…
Reference in New Issue