Skip to content
Snippets Groups Projects
Commit 43183096 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Creating maintenance mode myself!

parent c3d4440e
No related branches found
No related tags found
No related merge requests found
...@@ -93,7 +93,6 @@ MIDDLEWARE_CLASSES = ( ...@@ -93,7 +93,6 @@ MIDDLEWARE_CLASSES = (
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'common.middleware.whodid.WhodidMiddleware', 'common.middleware.whodid.WhodidMiddleware',
'django.middleware.locale.LocaleMiddleware', 'django.middleware.locale.LocaleMiddleware',
'maintenancemode.middleware.MaintenanceModeMiddleware',
'security.middleware.check_login_middleware.CheckLoginMiddleware' 'security.middleware.check_login_middleware.CheckLoginMiddleware'
# Uncomment the next line for simple clickjacking protection: # Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware', # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
......
{% extends "base.html" %} <html>
{% load i18n %} <head><title>Site down for maintenance</title></head>
{% block title %}{% trans "Temporarily down for maintenance" %}{% endblock %} <body>
{% block content %} <img src="/static/images/logo_vips_newest.png"/>
<h1>{% trans "Temporarily down for maintenance" %}</h1> <h1>Site down for maintenance</h1>
<p>{% trans "We are sorry, but the web site is currently underdoing maintenance. We should be back online shortly." %}</p> <p>We are sorry, but the web site is currently underdoing maintenance. We should be back online shortly.</p>
{% endblock %} </body>
</html>
\ No newline at end of file
...@@ -32,37 +32,42 @@ js_info_dict = { ...@@ -32,37 +32,42 @@ js_info_dict = {
'domain': 'djangojs', 'domain': 'djangojs',
} }
urlpatterns = patterns('', if settings.MAINTENANCE_MODE is True:
# Examples: urlpatterns = patterns('',
# url(r'^$', 'VIPSWeb.views.home', name='home'), url(r'^$', views.maintenance, name='maintenance')
# url(r'^VIPSWeb/', include('VIPSWeb.foo.urls')), )
else:
# Uncomment the admin/doc line below to enable admin documentation: urlpatterns = patterns('',
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # Examples:
# url(r'^$', 'VIPSWeb.views.home', name='home'),
url(r'^forecasts/', include('forecasts.urls', namespace = "forecasts")), # url(r'^VIPSWeb/', include('VIPSWeb.foo.urls')),
url(r'^messages/', include('vips_messages.urls', namespace = "vips_messages")),
url(r'^organisms/', include('organisms.urls', namespace = "organisms")), # Uncomment the admin/doc line below to enable admin documentation:
url(r'^observations/', include('observations.urls', namespace = "observations")), # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^information/', include('information.urls', namespace = "information")),
url(r'^blotch/', include('cerealblotchmodels.urls', namespace = "cerealblotchmodels")), url(r'^forecasts/', include('forecasts.urls', namespace = "forecasts")),
url(r'^calculators/', include('calculators.urls', namespace = "calculators")), url(r'^messages/', include('vips_messages.urls', namespace = "vips_messages")),
url(r'^roughage/', include('roughage.urls', namespace = "roughage")), url(r'^organisms/', include('organisms.urls', namespace = "organisms")),
url(r'^security/', include('security.urls', namespace = "security")), url(r'^observations/', include('observations.urls', namespace = "observations")),
url(r'^fusarium/', include('fusarium.urls', namespace = "fusarium")), url(r'^information/', include('information.urls', namespace = "information")),
url(r'^applefruitmoth/', include('applefruitmoth.urls', namespace = "applefruitmoth")), url(r'^blotch/', include('cerealblotchmodels.urls', namespace = "cerealblotchmodels")),
# Uncomment the next line to enable the admin: url(r'^calculators/', include('calculators.urls', namespace = "calculators")),
url(r'^admin/', include(admin.site.urls)), url(r'^roughage/', include('roughage.urls', namespace = "roughage")),
url(r'^tinymce/', include('tinymce.urls')), url(r'^security/', include('security.urls', namespace = "security")),
# Static serving of media files url(r'^fusarium/', include('fusarium.urls', namespace = "fusarium")),
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), url(r'^applefruitmoth/', include('applefruitmoth.urls', namespace = "applefruitmoth")),
# Enabling translation in JavaScript files # Uncomment the next line to enable the admin:
# See https://docs.djangoproject.com/en/1.6/topics/i18n/translation/#internationalization-in-javascript-code url(r'^admin/', include(admin.site.urls)),
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), url(r'^tinymce/', include('tinymce.urls')),
(r'^i18n/', include('django.conf.urls.i18n')), # Static serving of media files
(r'^settings.js', views.settings_js), url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
(r'^vipslogicproxy/(?P<path>.*)$', views.vipslogicproxy), # Enabling translation in JavaScript files
# Default view is index # See https://docs.djangoproject.com/en/1.6/topics/i18n/translation/#internationalization-in-javascript-code
url(r'^$', views.index, name='index'), (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
#url(r'^$', TemplateView.as_view(template_name="index.html")) (r'^i18n/', include('django.conf.urls.i18n')),
) (r'^settings.js', views.settings_js),
(r'^vipslogicproxy/(?P<path>.*)$', views.vipslogicproxy),
# Default view is index
url(r'^$', views.index, name='index'),
#url(r'^$', TemplateView.as_view(template_name="index.html"))
)
...@@ -68,6 +68,9 @@ def settings_js(request): ...@@ -68,6 +68,9 @@ def settings_js(request):
def resourcebundle(request): def resourcebundle(request):
return render(request, 'resourcebundle.js',content_type="application/javascript") return render(request, 'resourcebundle.js',content_type="application/javascript")
def maintenance(request):
return render(request, '503.html')
@cache_page(60 * 10) @cache_page(60 * 10)
@gzip_page @gzip_page
def vipslogicproxy(request, path): def vipslogicproxy(request, path):
......
# #
# Copyright (c) 2014 NIBIO <http://www.nibio.no/>. # Copyright (c) 2016 NIBIO <http://www.nibio.no/>.
# #
# This file is part of VIPSWeb. # This file is part of VIPSWeb.
# VIPSWeb is free software: you can redistribute it and/or modify # VIPSWeb is free software: you can redistribute it and/or modify
...@@ -23,4 +23,3 @@ Pillow ...@@ -23,4 +23,3 @@ Pillow
requests==2.6.0 requests==2.6.0
django-tinymce django-tinymce
python-dateutil==1.5 python-dateutil==1.5
django-maintenancemode
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment