add batiskaf.context_processors.dev

master
Stepan Krapivin 8 years ago
parent 9a9cbea429
commit a690891eaf
  1. 15
      batiskaf/context_processors.py
  2. 4
      batiskaf/settings.py
  3. 5
      batiskaf/templates/jinja2/base.jinja

@ -0,0 +1,15 @@
from django.conf import settings
def dev(request):
try:
PROD_MODE = settings.PROD_MODE
except AttributeError:
PROD_MODE = True
context = {
'PROD_MODE': PROD_MODE
}
context['request'] = request
return context

@ -185,6 +185,7 @@ TEMPLATES = [
"django.core.context_processors.tz",
"django.core.context_processors.request",
"django.contrib.messages.context_processors.messages",
"batiskaf.context_processors.dev"
)
},
},
@ -293,3 +294,6 @@ DPD_SERVER = 'http://ws.dpd.ru'
RESUME_DTYS_DELAY_SECONDS = 60 * 3
PROD_MODE = True # set to False on test/dev server

@ -247,6 +247,7 @@
</p>
</div>
<div class="col-xs-6 text-right">
{% if PROD_MODE %}
<!-- Yandex.Metrika informer -->
<a href="https://metrika.yandex.ru/stat/?id=30685703&amp;from=informer"
target="_blank" rel="nofollow"><img
@ -297,6 +298,7 @@
border=0 height=31 width=88
alt='Дайвинг - рейтинг DIVEtop'></a>
<!--/COUNTER-->
{% endif %}
</div>
</div>
</div>
@ -393,6 +395,8 @@
{% endfor %}
</script>
{% endif %}
{% if PROD_MODE %}
<!-- BEGIN JIVOSITE CODE {literal} -->
<script type='text/javascript'>
(function () {
@ -405,5 +409,6 @@
ss.parentNode.insertBefore(s, ss);
})();</script>
<!-- {/literal} END JIVOSITE CODE -->
{% endif %}
</body>
</html>

Loading…
Cancel
Save