Ver código fonte

Added a context processor for putting the current version into the base template

master
David Winterbottom 14 anos atrás
pai
commit
84e50ae54e

+ 5
- 0
oscar/core/context_processors.py Ver arquivo

@@ -0,0 +1,5 @@
1
+from django.conf import settings
2
+
3
+
4
+def metadata(request):
5
+    return {'version': getattr(settings, 'VERSION', 'N/A')}

+ 1
- 0
oscar/templates/base.html Ver arquivo

@@ -46,5 +46,6 @@
46 46
 				{% endblock %}
47 47
 			});
48 48
 		</script>
49
+		<!-- Version: {{ version }} -->
49 50
     </body>
50 51
 </html>

+ 2
- 1
sandbox/settings.py Ver arquivo

@@ -89,6 +89,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
89 89
     'oscar.apps.search.context_processors.search_form',
90 90
     'oscar.apps.promotions.context_processors.promotions',
91 91
     'oscar.apps.checkout.context_processors.checkout',
92
+    'oscar.core.context_processors.metadata',
92 93
 ) 
93 94
 
94 95
 MIDDLEWARE_CLASSES = (
@@ -99,7 +100,7 @@ MIDDLEWARE_CLASSES = (
99 100
     'django.contrib.messages.middleware.MessageMiddleware',
100 101
     'django.middleware.transaction.TransactionMiddleware',
101 102
     'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
102
-    'debug_toolbar.middleware.DebugToolbarMiddleware',
103
+#    'debug_toolbar.middleware.DebugToolbarMiddleware',
103 104
     'oscar.apps.basket.middleware.BasketMiddleware',
104 105
 )
105 106
 

Carregando…
Cancelar
Salvar