Skip to content
Snippets Groups Projects
Commit 998945d7 authored by Jörn Künsemöller's avatar Jörn Künsemöller
Browse files

TMSS-403: Improvement: use build/installed TMSS settings module and LOFARROOT...

TMSS-403: Improvement: use build/installed TMSS settings module and LOFARROOT for static files and templates so that django toolbar and frontend work out of the box
parent 327d96f3
No related branches found
No related tags found
1 merge request!257Resolve TMSS-403
...@@ -133,6 +133,7 @@ DEBUG_TOOLBAR_CONFIG = { ...@@ -133,6 +133,7 @@ DEBUG_TOOLBAR_CONFIG = {
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.gzip.GZipMiddleware', 'django.middleware.gzip.GZipMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
...@@ -148,7 +149,7 @@ ROOT_URLCONF = 'lofar.sas.tmss.tmss.urls' ...@@ -148,7 +149,7 @@ ROOT_URLCONF = 'lofar.sas.tmss.tmss.urls'
TEMPLATES = [ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR, os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, '../frontend','tmss_webapp')], 'DIRS': [BASE_DIR, os.path.join(BASE_DIR, 'templates'), os.path.join(os.environ.get('LOFARROOT'), 'SAS/TMSS/frontend','tmss_webapp')],
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {
'context_processors': [ 'context_processors': [
...@@ -162,7 +163,7 @@ TEMPLATES = [ ...@@ -162,7 +163,7 @@ TEMPLATES = [
] ]
STATICFILES_DIRS = [ STATICFILES_DIRS = [
os.path.join(BASE_DIR, '../frontend','tmss_webapp/build/static') os.path.join(os.environ.get('LOFARROOT'), 'SAS/TMSS/frontend','tmss_webapp/build/static')
] ]
WSGI_APPLICATION = 'lofar.sas.tmss.tmss.wsgi.application' WSGI_APPLICATION = 'lofar.sas.tmss.tmss.wsgi.application'
......
...@@ -33,7 +33,7 @@ def subtask_parset(request, subtask_pk:int): ...@@ -33,7 +33,7 @@ def subtask_parset(request, subtask_pk:int):
def index(request): def index(request):
return render(request, os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), '../../frontend','tmss_webapp/build/index.html')) return render(request, os.path.join(os.environ.get('LOFARROOT'), 'SAS/TMSS/frontend','tmss_webapp/build/index.html'))
#return render(request, "../../../frontend/frontend_poc/build/index.html") #return render(request, "../../../frontend/frontend_poc/build/index.html")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment