added timezone detection
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
{% load cookielaw_tags %}
|
{% load cookielaw_tags %}
|
||||||
{% load leaflet_tags %}
|
{% load leaflet_tags %}
|
||||||
|
{% load tz_detect %}
|
||||||
|
{% tz_detect %}
|
||||||
{% load analytical %}
|
{% load analytical %}
|
||||||
{% block filters %}
|
{% block filters %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="grid_12">
|
<div class="grid_12">
|
||||||
|
<p class="midden">
|
||||||
|
Local Time: {% now "jS F Y H:i" %}
|
||||||
|
</p>
|
||||||
<p class="midden">
|
<p class="midden">
|
||||||
Compatible with:
|
Compatible with:
|
||||||
<img src="/static/img/stravasquare.png" alt="Strava icon" width="30" height="30">
|
<img src="/static/img/stravasquare.png" alt="Strava icon" width="30" height="30">
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ from dataprep import timedeltaconv
|
|||||||
|
|
||||||
from scipy.interpolate import griddata
|
from scipy.interpolate import griddata
|
||||||
|
|
||||||
LOCALTIMEZONE = tz('Etc/UTC')
|
#LOCALTIMEZONE = tz('Etc/UTC')
|
||||||
USER_LANGUAGE = 'en-US'
|
USER_LANGUAGE = 'en-US'
|
||||||
|
|
||||||
from interactiveplots import *
|
from interactiveplots import *
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ INSTALLED_APPS = [
|
|||||||
'corsheaders',
|
'corsheaders',
|
||||||
'analytical',
|
'analytical',
|
||||||
'cookielaw',
|
'cookielaw',
|
||||||
'django_extensions'
|
'django_extensions',
|
||||||
|
'tz_detect'
|
||||||
]
|
]
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS = (
|
AUTHENTICATION_BACKENDS = (
|
||||||
@@ -90,6 +91,7 @@ MIDDLEWARE_CLASSES = [
|
|||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
'async_messages.middleware.AsyncMiddleware',
|
'async_messages.middleware.AsyncMiddleware',
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
'tz_detect.middleware.TimezoneMiddleware',
|
||||||
]
|
]
|
||||||
|
|
||||||
ROOT_URLCONF = 'rowsandall_app.urls'
|
ROOT_URLCONF = 'rowsandall_app.urls'
|
||||||
@@ -174,7 +176,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/1.9/topics/i18n/
|
# https://docs.djangoproject.com/en/1.9/topics/i18n/
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
#TIME_ZONE = 'UTC'
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
@@ -182,6 +184,8 @@ USE_L10N = True
|
|||||||
|
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
|
TZ_DETECT_COUNTRIES = ('US','DE','GB','CZ','FR','IT')
|
||||||
|
|
||||||
LOCALE_PATHS = (
|
LOCALE_PATHS = (
|
||||||
os.path.join(BASE_DIR, 'locale'),
|
os.path.join(BASE_DIR, 'locale'),
|
||||||
os.path.join(BASE_DIR, 'cvkbrno/locale'),
|
os.path.join(BASE_DIR, 'cvkbrno/locale'),
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ urlpatterns += [
|
|||||||
url(r'^tp\_callback',rowersviews.rower_process_tpcallback),
|
url(r'^tp\_callback',rowersviews.rower_process_tpcallback),
|
||||||
url(r'^twitter\_callback',rowersviews.rower_process_twittercallback),
|
url(r'^twitter\_callback',rowersviews.rower_process_twittercallback),
|
||||||
url(r'^i18n/', include('django.conf.urls.i18n')),
|
url(r'^i18n/', include('django.conf.urls.i18n')),
|
||||||
|
url(r'^tz_detect/', include('tz_detect.urls')),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
{% load leaflet_tags %}
|
{% load leaflet_tags %}
|
||||||
{% load cookielaw_tags %}
|
{% load cookielaw_tags %}
|
||||||
|
{% load tz_detect %}
|
||||||
|
{% tz_detect %}
|
||||||
{% load analytical %}
|
{% load analytical %}
|
||||||
{% block filters %}
|
{% block filters %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user