diff --git a/settings/default.py b/settings/default.py index 2d6e665e2339be65120643e0841ca3d004ca15ab..2f4fa4a96137629782e0f01500423da0234e347b 100644 --- a/settings/default.py +++ b/settings/default.py @@ -257,30 +257,64 @@ ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = DEFAULT_SECRET_KEY +# Upgrade template settings to 1.8 +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [ + '/home/gracedb/gracedb/templates', + ], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + # Defaults + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.core.context_processors.static', + # Extra additions + 'django.core.context_processors.request', + 'gracedb.middleware.auth.LigoAuthContext', + 'middleware.debug.LigoDebugContext', + 'ligoauth.context_processors.shib_login_url', + ], + }, + }, +] + # List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - #'django.template.loaders.filesystem.load_template_source', - # replaced by... - 'django.template.loaders.filesystem.Loader', - # Upgrade to 1.4 - #'django.template.loaders.app_directories.load_template_source', - 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.load_template_source', -) +#TEMPLATE_LOADERS = ( +# #'django.template.loaders.filesystem.load_template_source', +# # replaced by... +# 'django.template.loaders.filesystem.Loader', +# # Upgrade to 1.4 +# #'django.template.loaders.app_directories.load_template_source', +# 'django.template.loaders.app_directories.Loader', +## 'django.template.loaders.eggs.load_template_source', +#) +# +#TEMPLATE_CONTEXT_PROCESSORS = ( +# #"django.core.context_processors.auth", +# # replaced by... +# "django.contrib.auth.context_processors.auth", +# "django.core.context_processors.debug", +# "django.core.context_processors.i18n", +# "django.core.context_processors.media", +# "django.core.context_processors.static", +# "django.core.context_processors.request", +# "gracedb.middleware.auth.LigoAuthContext", +# 'middleware.debug.LigoDebugContext', +# 'ligoauth.context_processors.shib_login_url', +#) +# +## Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". +## Always use forward slashes, even on Windows. +## Don't forget to use absolute paths, not relative paths. +#TEMPLATE_DIRS = ( +# "/home/gracedb/gracedb/templates", +#) -TEMPLATE_CONTEXT_PROCESSORS = ( - #"django.core.context_processors.auth", - # replaced by... - "django.contrib.auth.context_processors.auth", - "django.core.context_processors.debug", - "django.core.context_processors.i18n", - "django.core.context_processors.media", - "django.core.context_processors.static", - "django.core.context_processors.request", - "gracedb.middleware.auth.LigoAuthContext", - 'middleware.debug.LigoDebugContext', - 'ligoauth.context_processors.shib_login_url', -) AUTHENTICATION_BACKENDS = ( # 'gracedb.middleware.auth.LigoAuthBackend', @@ -322,13 +356,6 @@ MIDDLEWARE_CLASSES = [ ROOT_URLCONF = 'urls' -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - "/home/gracedb/gracedb/templates", -) - INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.admin', diff --git a/templates/base.html b/templates/base.html index 866070ceb0ed63cd13e54a55823381d77724c77c..9d0e73dca9cbe374f1db1b847a40ea6e6b50b453 100644 --- a/templates/base.html +++ b/templates/base.html @@ -32,24 +32,30 @@ function changeTime(obj, label) { <div id="content"> <center> -<h1> GraceDB — Gravitational Wave Candidate Event Database</h1> +<h1>GraceDB — Gravitational Wave Candidate Event Database</h1> </center> {% block nav %} {% include "navbar_frag.html" %} {% endblock %} - <p> </p> <!-- bad way to create vertical space --> + <p> </p> <!-- bad way to create vertical space --> {% load flash %} {% flash %} <div id="status_block" class="{{ params.class }}">{{ msg }}</div> {% endflash %} +{% if user.is_staff %} +<!-- debug information for admins --> +<div id="debugDiv"> + <!--<pre>{% filter force_escape %} {% debug %} {% endfilter %}</pre> --> +</div> +{% endif %} - <h2>{% block heading %}Title{% endblock %}</h2> - + <h2>{% block heading %}Title{% endblock %}</h2> +<p>test</p> {% block content %}{% endblock %} </div>