Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Update code to be compatible with django 1.10

Roland Geider4cee67e40e77
diff --git a/requirements.txt b/requirements.txt
index 50bd2a341..4ad94c39a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,7 +2,7 @@
# Requirements for wger for production
#
-Django>=1.9,<1.10
+Django>=1.10,<1.11
django-recaptcha
reportlab
django_mobile
@@ -21,7 +21,7 @@ invoke
requests
# REST API
-djangorestframework>=3.2,<3.3
+djangorestframework>=3.4,<3.5
django-filter
django-tastypie
django-cors-headers
diff --git a/wger/config/urls.py b/wger/config/urls.py
index 2f4df0c60..3b6e15eb5 100644
--- a/wger/config/urls.py
+++ b/wger/config/urls.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls import patterns, url, include
+from django.conf.urls import url, include
from wger.config.views import language_config
from wger.config.views import gym_config
diff --git a/wger/core/urls.py b/wger/core/urls.py
index 532b70d2b..0a2177462 100644
--- a/wger/core/urls.py
+++ b/wger/core/urls.py
@@ -16,7 +16,6 @@
from django.conf.urls import (
- patterns,
url,
include
)
diff --git a/wger/exercises/urls.py b/wger/exercises/urls.py
index ca4b04c8c..29d4582ff 100644
--- a/wger/exercises/urls.py
+++ b/wger/exercises/urls.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls import patterns, url, include
+from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from wger.exercises.views import (
diff --git a/wger/manager/urls.py b/wger/manager/urls.py
index 9de289b5e..e8a50d662 100644
--- a/wger/manager/urls.py
+++ b/wger/manager/urls.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls import patterns, url, include
+from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from wger.manager.views import (
diff --git a/wger/nutrition/templates/bmi/form.html b/wger/nutrition/templates/bmi/form.html
index b756dc952..d0626bbd0 100644
--- a/wger/nutrition/templates/bmi/form.html
+++ b/wger/nutrition/templates/bmi/form.html
@@ -26,14 +26,14 @@ div.bmi-legend {
<script>
$(document).ready(function () {
- wgerRenderBodyMassIndex({% if flavour = 'mobile'%}$('#content').width() * 0.95{% endif %});
+ wgerRenderBodyMassIndex({% if flavour == 'mobile'%}$('#content').width() * 0.95{% endif %});
/*
* Process the form
*/
$("#bmi-form").click(function(e){
e.preventDefault();
- wgerRenderBodyMassIndex({% if flavour = 'mobile'%}$('#content').width() * 0.95{% endif %});
+ wgerRenderBodyMassIndex({% if flavour == 'mobile'%}$('#content').width() * 0.95{% endif %});
});
});
diff --git a/wger/nutrition/urls.py b/wger/nutrition/urls.py
index d768fc3f4..3da3389e9 100644
--- a/wger/nutrition/urls.py
+++ b/wger/nutrition/urls.py
@@ -17,7 +17,6 @@
from django.contrib.auth.decorators import login_required
from django.conf.urls import (
- patterns,
url,
include
)
diff --git a/wger/settings_global.py b/wger/settings_global.py
index abba0a87b..85d165abc 100644
--- a/wger/settings_global.py
+++ b/wger/settings_global.py
@@ -168,6 +168,11 @@ TEMPLATES = [
},
]
+# TODO: Temporary fix for django 1.10 and the django-mobile app. If issue #72
+# is closed, this can be removed.
+# https://github.com/gregmuellegger/django-mobile/issues/72
+TEMPLATE_LOADERS = TEMPLATES[0]['OPTIONS']['loaders']
+
# Store the user messages in the session
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
diff --git a/wger/weight/urls.py b/wger/weight/urls.py
index 6e0767f29..2c7e252e8 100644
--- a/wger/weight/urls.py
+++ b/wger/weight/urls.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls import patterns, url
+from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from wger.weight.forms import WeightCsvImportForm