Private
Public Access
1
0

added timezone detection

This commit is contained in:
Sander Roosendaal
2017-09-03 12:11:19 +02:00
parent 58ab1f87bb
commit bd46c5bcd7
6 changed files with 15 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
{% load cookielaw_tags %}
{% load leaflet_tags %}
{% load tz_detect %}
{% tz_detect %}
{% load analytical %}
{% block filters %}
{% endblock %}

View File

@@ -7,6 +7,9 @@
{% block content %}
<div class="grid_12">
<p class="midden">
Local Time: {% now "jS F Y H:i" %}
</p>
<p class="midden">
Compatible with:
<img src="/static/img/stravasquare.png" alt="Strava icon" width="30" height="30">

View File

@@ -143,7 +143,7 @@ from dataprep import timedeltaconv
from scipy.interpolate import griddata
LOCALTIMEZONE = tz('Etc/UTC')
#LOCALTIMEZONE = tz('Etc/UTC')
USER_LANGUAGE = 'en-US'
from interactiveplots import *

View File

@@ -62,7 +62,8 @@ INSTALLED_APPS = [
'corsheaders',
'analytical',
'cookielaw',
'django_extensions'
'django_extensions',
'tz_detect'
]
AUTHENTICATION_BACKENDS = (
@@ -90,6 +91,7 @@ MIDDLEWARE_CLASSES = [
'django.contrib.messages.middleware.MessageMiddleware',
'async_messages.middleware.AsyncMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'tz_detect.middleware.TimezoneMiddleware',
]
ROOT_URLCONF = 'rowsandall_app.urls'
@@ -174,7 +176,7 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/
TIME_ZONE = 'UTC'
#TIME_ZONE = 'UTC'
USE_I18N = True
@@ -182,6 +184,8 @@ USE_L10N = True
USE_TZ = True
TZ_DETECT_COUNTRIES = ('US','DE','GB','CZ','FR','IT')
LOCALE_PATHS = (
os.path.join(BASE_DIR, 'locale'),
os.path.join(BASE_DIR, 'cvkbrno/locale'),

View File

@@ -71,6 +71,7 @@ urlpatterns += [
url(r'^tp\_callback',rowersviews.rower_process_tpcallback),
url(r'^twitter\_callback',rowersviews.rower_process_twittercallback),
url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^tz_detect/', include('tz_detect.urls')),
]

View File

@@ -1,5 +1,7 @@
{% load leaflet_tags %}
{% load cookielaw_tags %}
{% load tz_detect %}
{% tz_detect %}
{% load analytical %}
{% block filters %}
{% endblock %}