diff --git a/VIPSWeb/local_settings_sample.py b/VIPSWeb/local_settings_sample.py index 33cfd8ade787b1e0cffbc26dcdfa29eb1fed5a02..7ed9ab8a66f6a3a11febb8a4c0b91341be72b2b0 100755 --- a/VIPSWeb/local_settings_sample.py +++ b/VIPSWeb/local_settings_sample.py @@ -25,7 +25,7 @@ ## Change these for every new instance of the app import os # MUST be lazy, otherwise the app crashes -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ DEBUG = True MAINTENANCE_MODE = False diff --git a/VIPSWeb/templatetags/template_helper.py b/VIPSWeb/templatetags/template_helper.py index 792005e11bbda37510c462ac755c4f911104cc61..0c3006ea621f0dd8c1fbd3e3d14a348d359ef1f2 100755 --- a/VIPSWeb/templatetags/template_helper.py +++ b/VIPSWeb/templatetags/template_helper.py @@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- from django import template -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.utils import translation from django.conf import settings from datetime import datetime diff --git a/VIPSWeb/urls.py b/VIPSWeb/urls.py index 681c5c57d12edf83cfd960e2c9a0de1dbb94db84..499d6a6fbd6dd49c717e6e10421334670f767e7a 100755 --- a/VIPSWeb/urls.py +++ b/VIPSWeb/urls.py @@ -16,7 +16,8 @@ # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import include, url +from django.conf.urls import include +from django.urls import re_path #from django.views.generic import TemplateView from django.views.static import serve from django.views.i18n import JavaScriptCatalog @@ -38,7 +39,7 @@ js_info_dict = { if settings.MAINTENANCE_MODE is True: urlpatterns = [ - url(r'^$', views.maintenance, name='maintenance') + re_path(r'^$', views.maintenance, name='maintenance') ] else: urlpatterns = [ @@ -49,31 +50,31 @@ else: # Uncomment the admin/doc line below to enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), - url(r'^cydiapomonella/', include('cydiapomonella.urls')), - url(r'^forecasts/', include('forecasts.urls', namespace = "forecasts")), - url(r'^messages/', include('vips_messages.urls', namespace = "vips_messages")), - url(r'^organisms/', include('organisms.urls', namespace = "organisms")), - url(r'^observations/', include('observations.urls', namespace = "observations")), - url(r'^information/', include('information.urls', namespace = "information")), - url(r'^blotch/', include('cerealblotchmodels.urls', namespace = "cerealblotchmodels")), - url(r'^calculators/', include('calculators.urls', namespace = "calculators")), - url(r'^roughage/', include('roughage.urls', namespace = "roughage")), - url(r'^security/', include('security.urls', namespace = "security")), - url(r'^fusarium/', include('fusarium.urls', namespace = "fusarium")), - url(r'^applefruitmoth/', include('applefruitmoth.urls', namespace = "applefruitmoth")), - url(r'^mock/', include('mock.urls', namespace = "mock")), + re_path(r'^cydiapomonella/', include('cydiapomonella.urls')), + re_path(r'^forecasts/', include('forecasts.urls', namespace = "forecasts")), + re_path(r'^messages/', include('vips_messages.urls', namespace = "vips_messages")), + re_path(r'^organisms/', include('organisms.urls', namespace = "organisms")), + re_path(r'^observations/', include('observations.urls', namespace = "observations")), + re_path(r'^information/', include('information.urls', namespace = "information")), + re_path(r'^blotch/', include('cerealblotchmodels.urls', namespace = "cerealblotchmodels")), + re_path(r'^calculators/', include('calculators.urls', namespace = "calculators")), + re_path(r'^roughage/', include('roughage.urls', namespace = "roughage")), + re_path(r'^security/', include('security.urls', namespace = "security")), + re_path(r'^fusarium/', include('fusarium.urls', namespace = "fusarium")), + re_path(r'^applefruitmoth/', include('applefruitmoth.urls', namespace = "applefruitmoth")), + re_path(r'^mock/', include('mock.urls', namespace = "mock")), # Uncomment the next line to enable the admin: - url(r'^admin/', admin.site.urls), - url(r'^tinymce/', include('tinymce.urls')), + re_path(r'^admin/', admin.site.urls), + re_path(r'^tinymce/', include('tinymce.urls')), # Static serving of media files - url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}), + re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}), # Enabling translation in JavaScript files # See https://docs.djangoproject.com/en/1.6/topics/i18n/translation/#internationalization-in-javascript-code - url(r'^jsi18n/$', JavaScriptCatalog.as_view(packages=js_info_dict['packages']), name='javascript-catalog'), - url(r'^i18n/', include('django.conf.urls.i18n')), - url(r'^settings.js', views.settings_js, name="views.settings_js"), - url(r'^vipslogicproxy/(?P<path>.*)$', views.vipslogicproxy), + re_path(r'^jsi18n/$', JavaScriptCatalog.as_view(packages=js_info_dict['packages']), name='javascript-catalog'), + re_path(r'^i18n/', include('django.conf.urls.i18n')), + re_path(r'^settings.js', views.settings_js, name="views.settings_js"), + re_path(r'^vipslogicproxy/(?P<path>.*)$', views.vipslogicproxy), # Default view is index - url(r'^$', views.index, name='index'), + re_path(r'^$', views.index, name='index'), #url(r'^$', TemplateView.as_view(template_name="index.html")) ] diff --git a/applefruitmoth/urls.py b/applefruitmoth/urls.py index 92ccac728202b4f6ced03a8c72aedcbdd283f192..f694372d9ee5f0ea4b13168d2c3f43b10c8f3569 100755 --- a/applefruitmoth/urls.py +++ b/applefruitmoth/urls.py @@ -16,12 +16,11 @@ # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url - +from django.urls import re_path from applefruitmoth import views app_name = "applefruitmoth" urlpatterns = [ - url(r'^$', views.index, name='index'), + re_path(r'^$', views.index, name='index'), ] \ No newline at end of file diff --git a/calculators/urls.py b/calculators/urls.py index 1661f2f18d47108c08e4b144d20ff8bb8903cf41..6c1644cb7752a1bde6d101bc1f3073fbacf5c996 100755 --- a/calculators/urls.py +++ b/calculators/urls.py @@ -15,13 +15,14 @@ # You should have received a copy of the NIBIO Open Source License # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url + +from django.urls import re_path from calculators import views app_name = "calculators" urlpatterns = [ # ex: /forecasts/ - url(r'^$', views.index, name='index'), - url(r'eil/', views.eil, name='eil') + re_path(r'^$', views.index, name='index'), + re_path(r'eil/', views.eil, name='eil') ] \ No newline at end of file diff --git a/cerealblotchmodels/urls.py b/cerealblotchmodels/urls.py index 375b0ccd0435ca8014d7f834ae6be8f8bcda0a25..e4368fe9d1603f1442fe5d7eb6050f19bada898e 100755 --- a/cerealblotchmodels/urls.py +++ b/cerealblotchmodels/urls.py @@ -15,14 +15,15 @@ # You should have received a copy of the NIBIO Open Source License # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url + +from django.urls import re_path from cerealblotchmodels import views app_name = "cerealblotchmodels" urlpatterns = [ # ex: /forecasts/ - url(r'^$', views.index, name='index'), - url(r'barleynetblotch/', views.barleynetblotchform, name='barleynetblotchform'), - url(r'septoriahumidity/', views.septoriahumidityform, name='septoriahumidityform') + re_path(r'^$', views.index, name='index'), + re_path(r'barleynetblotch/', views.barleynetblotchform, name='barleynetblotchform'), + re_path(r'septoriahumidity/', views.septoriahumidityform, name='septoriahumidityform') ] \ No newline at end of file diff --git a/cydiapomonella/urls.py b/cydiapomonella/urls.py index f5a4c4f6c80ba749dc9d50059cca79bb76120295..5005bba0554d72f317d49fab6a4214057d665fc5 100644 --- a/cydiapomonella/urls.py +++ b/cydiapomonella/urls.py @@ -1,9 +1,10 @@ -from django.conf.urls import url + +from django.urls import re_path from . import views urlpatterns = [ - url(r'^$', views.index,name='index'), + re_path(r'^$', views.index,name='index'), ] diff --git a/forecasts/models.py b/forecasts/models.py index 731375b52c052088033265b52c1cd231b4dc4878..cf56d7542afa24a628cd6da3012929a73cac375b 100755 --- a/forecasts/models.py +++ b/forecasts/models.py @@ -22,7 +22,7 @@ import requests import json from decimal import Decimal, InvalidOperation -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.conf import settings from django.db import models from django.utils import translation diff --git a/forecasts/urls.py b/forecasts/urls.py index ef8c0bb0d33bd68f5f977ea1d82cd288c3b06158..9c3499ec655f14f1c02dd877988c9951d3198eea 100755 --- a/forecasts/urls.py +++ b/forecasts/urls.py @@ -15,7 +15,8 @@ # You should have received a copy of the NIBIO Open Source License # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url + +from django.urls import re_path from django.views.decorators.cache import cache_page from forecasts import views @@ -24,16 +25,16 @@ app_name="forecasts" urlpatterns = [ # ex: /forecasts/ - url(r'^$', views.index, name='index'), + re_path(r'^$', views.index, name='index'), # ex: /forecasts/5/ #url(r'^(?P<forecast_id>\d+)/detail_highcharts_json/$', cache_page(60 * 15)(views.detail_highcharts_json), name='detail_highcharts_json'), - url(r'^(?P<forecast_id>-?\d+)/detail_highcharts_json/$', views.detail_highcharts_json, name='detail_highcharts_json'), + re_path(r'^(?P<forecast_id>-?\d+)/detail_highcharts_json/$', views.detail_highcharts_json, name='detail_highcharts_json'), #url(r'^(?P<forecast_id>\d+)/$', cache_page(60 * 15)(views.detail), name='detail'), - url(r'^(?P<forecast_id>-?\d+)/$', (views.detail), name='detail'), - url(r'^(?P<forecast_id>-?\d+)/(?P<latest_days>\d+)/$', (views.detail_latest_days), name='detail_latest_days'), - url(r'^models/test/$', views.models_detail_test, name='models_detail_test'), - url(r'^models/(?P<model_id>\w+)/$', views.models_detail, name='models_detail'), - url(r'^models/js/modelLocalNames.js', cache_page(60 * 30)(views.model_local_names_js), name='model_local_names_js'), - url(r'^models/$', views.models_index, name='models_index'), + re_path(r'^(?P<forecast_id>-?\d+)/$', (views.detail), name='detail'), + re_path(r'^(?P<forecast_id>-?\d+)/(?P<latest_days>\d+)/$', (views.detail_latest_days), name='detail_latest_days'), + re_path(r'^models/test/$', views.models_detail_test, name='models_detail_test'), + re_path(r'^models/(?P<model_id>\w+)/$', views.models_detail, name='models_detail'), + re_path(r'^models/js/modelLocalNames.js', cache_page(60 * 30)(views.model_local_names_js), name='model_local_names_js'), + re_path(r'^models/$', views.models_index, name='models_index'), ] \ No newline at end of file diff --git a/fusarium/urls.py b/fusarium/urls.py index e7b9cc8e48776a47e7771c8b163dde4813c5bb75..9fb1f77f68c7553c518ba04bc2e8512e632b1345 100755 --- a/fusarium/urls.py +++ b/fusarium/urls.py @@ -16,12 +16,11 @@ # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url - +from django.urls import re_path from fusarium import views app_name = "fusarium" urlpatterns = [ - url(r'^$', views.index, name='index'), + re_path(r'^$', views.index, name='index'), ] \ No newline at end of file diff --git a/information/models.py b/information/models.py index 6594c756b70db36f6bbf1a057b1eb5b7efacdde2..1911f446918a8b466d6cd48c126bb53b41220115 100755 --- a/information/models.py +++ b/information/models.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.db import models from tinymce import models as tinymce_models from django.conf import settings diff --git a/information/urls.py b/information/urls.py index cbbea48875ea001a90f86ba14a4eb089ead9215c..c13d2d73615216771a0bd2aaf81741523ec3d767 100755 --- a/information/urls.py +++ b/information/urls.py @@ -16,15 +16,14 @@ # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url - +from django.urls import re_path from information import views app_name = "information" urlpatterns = [ # ex: /messages/ - url(r'^$', views.index, name='index'), + re_path(r'^$', views.index, name='index'), # ex: /messages/5/ - url(r'^(?P<information_id>\d+)/$', views.detail, name='detail'), + re_path(r'^(?P<information_id>\d+)/$', views.detail, name='detail'), ] \ No newline at end of file diff --git a/mock/urls.py b/mock/urls.py index 76901112a6860351b8028b43b081c6f01b4c2106..c30c0dd0f53185d7d1aee1b8906a19f3d05557a2 100644 --- a/mock/urls.py +++ b/mock/urls.py @@ -16,11 +16,11 @@ # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url +from django.urls import re_path from mock import views app_name = "mock" urlpatterns = [ - url(r'^zymogridmapclient/$', views.zymogridmapclient, name='zymogridmapclient'), + re_path(r'^zymogridmapclient/$', views.zymogridmapclient, name='zymogridmapclient'), ] diff --git a/observations/urls.py b/observations/urls.py index 256641870add185a2fb11dd6ca3a79138a090706..09e94d6fc4de20141c21e7fc16c5f04a0c1c706a 100755 --- a/observations/urls.py +++ b/observations/urls.py @@ -15,7 +15,8 @@ # You should have received a copy of the NIBIO Open Source License # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url +#from django.conf.urls import url +from django.urls import re_path #from django.views.decorators.cache import cache_page from observations import views @@ -24,8 +25,8 @@ app_name = "observations" urlpatterns = [ # ex: /forecasts/ - url(r'^$', views.index, name='index'), - url(r'old', views.index_old, name='index_old'), + re_path(r'^$', views.index, name='index'), + re_path(r'old', views.index_old, name='index_old'), # ex: /observations/5/ - url(r'^(?P<observation_id>\d+)/$', (views.detail), name='detail'), + re_path(r'^(?P<observation_id>\d+)/$', (views.detail), name='detail'), ] \ No newline at end of file diff --git a/organisms/urls.py b/organisms/urls.py index 5055042aa86db69e5cadfd2155738c001357f041..b597deb886cc0205166f4086ea661056aca62731 100755 --- a/organisms/urls.py +++ b/organisms/urls.py @@ -16,7 +16,7 @@ # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url +from django.urls import re_path from organisms import views @@ -24,7 +24,7 @@ app_name = "organisms" urlpatterns = [ # ex: /organisms/ - url(r'^$', views.index, name='index'), + re_path(r'^$', views.index, name='index'), # ex: /organisms/5/ #url(r'^(?P<organism_id>\d+)/$', views.detail, name='detail'), ] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 99a24132ec388644d07a1f8b28de61092e1a99ff..de6ebdf452eef253d875f0f052c8ab9821105ae6 100755 --- a/requirements.txt +++ b/requirements.txt @@ -18,10 +18,10 @@ # Please add requirements here # Read docs for how this works: http://www.pip-installer.org/en/latest/cookbook.html -Django==3.2.16 +Django==4.0.8 Pillow requests==2.25.0 -django-tinymce==2.8.0 +django-tinymce==3.5.0 python-dateutil==2.8.1 django-extensions selenium diff --git a/roughage/urls.py b/roughage/urls.py index 36a7163778fba5225c80ed79fd08176b72f8ad93..d5b771515ca2f0b21ea190945c3cf21a2b884150 100755 --- a/roughage/urls.py +++ b/roughage/urls.py @@ -16,13 +16,13 @@ # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url +from django.urls import re_path from roughage import views app_name = "roughage" urlpatterns = [ - url(r'^nutrition/calibration/$', views.nutrition_calibration), - url(r'^nutrition/$', views.nutrition) + re_path(r'^nutrition/calibration/$', views.nutrition_calibration), + re_path(r'^nutrition/$', views.nutrition) ] \ No newline at end of file diff --git a/security/urls.py b/security/urls.py index 4e2f775711b99529740b961d85d8c4fa3f2a3a52..88849498a7b6a84943824f0fceab6f264c900ad1 100755 --- a/security/urls.py +++ b/security/urls.py @@ -16,14 +16,14 @@ # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url +from django.urls import re_path from security import views app_name = "security" urlpatterns = [ - url(r'^login/(?P<user_uuid>[^/]+)/$', views.login_user_uuid), - url(r'^login/$', views.login_form), - url(r'^logout/$', views.logout) + re_path(r'^login/(?P<user_uuid>[^/]+)/$', views.login_user_uuid), + re_path(r'^login/$', views.login_form), + re_path(r'^logout/$', views.logout) ] \ No newline at end of file diff --git a/vips_messages/models.py b/vips_messages/models.py index 16803ab6314b9590a858f01e9d8482a7c1d214b5..f4724ace674d330d263953b5c0c3e3d5939b3ab1 100755 --- a/vips_messages/models.py +++ b/vips_messages/models.py @@ -19,7 +19,7 @@ import requests from django.conf import settings from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from datetime import datetime class MessageTag: diff --git a/vips_messages/urls.py b/vips_messages/urls.py index 38f1f499a52386887390998b318fc32b7ff3200a..4a42a90ea5a07cb6523afc33f0220fa1c2f6dce1 100755 --- a/vips_messages/urls.py +++ b/vips_messages/urls.py @@ -16,7 +16,7 @@ # along with VIPSWeb. If not, see <http://www.nibio.no/licenses/>. # -from django.conf.urls import url +from django.urls import re_path from vips_messages import views @@ -24,8 +24,8 @@ app_name="vips_messages" urlpatterns = [ # ex: /messages/ - url(r'^$', views.index, name='index'), + re_path(r'^$', views.index, name='index'), # ex: /messages/5/ - url(r'^(?P<message_id>\d+)/$', views.detail, name='detail'), - url(r'^by_tag/json', views.messages_by_tag_json, name='messages_by_tag_json'), + re_path(r'^(?P<message_id>\d+)/$', views.detail, name='detail'), + re_path(r'^by_tag/json', views.messages_by_tag_json, name='messages_by_tag_json'), ] \ No newline at end of file