From 789dd759c9ca4d00cb8e533eb6e46fae0418d948 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 25 Jul 2023 16:14:10 -0400 Subject: [PATCH 01/24] Update ugettext -> gettext --- arches/app/datatypes/base.py | 2 +- arches/app/datatypes/concept_types.py | 2 +- arches/app/datatypes/datatypes.py | 4 ++-- arches/app/datatypes/url.py | 2 +- arches/app/etl_modules/base_data_editor.py | 2 +- arches/app/etl_modules/base_import_module.py | 2 +- arches/app/etl_modules/branch_csv_importer.py | 2 +- arches/app/etl_modules/import_single_csv.py | 2 +- arches/app/functions/primary_descriptors.py | 2 +- arches/app/models/concept.py | 2 +- arches/app/models/graph.py | 2 +- arches/app/models/models.py | 2 +- arches/app/models/resource.py | 2 +- arches/app/models/tile.py | 2 +- arches/app/search/base_index.py | 2 +- arches/app/search/components/map_filter.py | 2 +- arches/app/search/elasticsearch_dsl_builder.py | 2 +- arches/app/search/search_export.py | 2 +- arches/app/tasks.py | 2 +- arches/app/utils/data_management/resources/formats/csvfile.py | 2 +- arches/app/utils/data_management/resources/formats/format.py | 2 +- .../utils/data_management/sparql_providers/aat_provider.py | 2 +- arches/app/utils/forms.py | 2 +- arches/app/utils/middleware.py | 2 +- arches/app/utils/response.py | 2 +- arches/app/utils/task_management.py | 2 +- arches/app/views/api.py | 2 +- arches/app/views/auth.py | 2 +- arches/app/views/concept.py | 2 +- arches/app/views/etl_manager.py | 2 +- arches/app/views/graph.py | 2 +- arches/app/views/language.py | 2 +- arches/app/views/manifest_manager.py | 2 +- arches/app/views/map.py | 2 +- arches/app/views/plugin.py | 2 +- arches/app/views/resource.py | 2 +- arches/app/views/search.py | 2 +- arches/app/views/tile.py | 2 +- arches/app/views/user.py | 2 +- arches/management/commands/load_ontology.py | 2 +- 40 files changed, 41 insertions(+), 41 deletions(-) diff --git a/arches/app/datatypes/base.py b/arches/app/datatypes/base.py index efa6adabc5d..649f3bc7acd 100644 --- a/arches/app/datatypes/base.py +++ b/arches/app/datatypes/base.py @@ -3,7 +3,7 @@ from arches.app.models import models from arches.app.models.system_settings import settings from arches.app.search.elasticsearch_dsl_builder import Dsl, Bool, Terms, Exists, Nested -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ import logging logger = logging.getLogger(__name__) diff --git a/arches/app/datatypes/concept_types.py b/arches/app/datatypes/concept_types.py index 6937e194312..42915e39023 100644 --- a/arches/app/datatypes/concept_types.py +++ b/arches/app/datatypes/concept_types.py @@ -3,7 +3,7 @@ import csv import logging from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.models import models from arches.app.models import concept from django.core.cache import cache diff --git a/arches/app/datatypes/datatypes.py b/arches/app/datatypes/datatypes.py index b2322becaf7..11a10f96717 100644 --- a/arches/app/datatypes/datatypes.py +++ b/arches/app/datatypes/datatypes.py @@ -48,7 +48,7 @@ from django.core.files import File from django.core.files.base import ContentFile from django.core.files.storage import FileSystemStorage, default_storage -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis.geos import GeometryCollection from django.contrib.gis.geos import fromstr @@ -56,7 +56,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ValidationError from django.db import connection, transaction -from django.utils.translation import get_language, ugettext as _ +from django.utils.translation import get_language, gettext as _ from elasticsearch import Elasticsearch from elasticsearch.exceptions import NotFoundError diff --git a/arches/app/datatypes/url.py b/arches/app/datatypes/url.py index cf496dd8718..594c53610c8 100644 --- a/arches/app/datatypes/url.py +++ b/arches/app/datatypes/url.py @@ -27,7 +27,7 @@ from rdflib import ConjunctiveGraph as Graph from rdflib import URIRef, Literal, Namespace from rdflib.namespace import RDF, RDFS, XSD, DC, DCTERMS -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ archesproject = Namespace(settings.ARCHES_NAMESPACE_FOR_DATA_EXPORT) cidoc_nm = Namespace("http://www.cidoc-crm.org/cidoc-crm/") diff --git a/arches/app/etl_modules/base_data_editor.py b/arches/app/etl_modules/base_data_editor.py index 8031326304b..caadb6cded5 100644 --- a/arches/app/etl_modules/base_data_editor.py +++ b/arches/app/etl_modules/base_data_editor.py @@ -5,7 +5,7 @@ import uuid from django.db import connection from django.http import HttpRequest -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.datatypes.datatypes import DataTypeFactory from arches.app.etl_modules.base_import_module import BaseImportModule from arches.app.models.models import GraphModel, Node diff --git a/arches/app/etl_modules/base_import_module.py b/arches/app/etl_modules/base_import_module.py index d040efe8ba4..0e8842c8bb7 100644 --- a/arches/app/etl_modules/base_import_module.py +++ b/arches/app/etl_modules/base_import_module.py @@ -2,7 +2,7 @@ import os from django.core.files.storage import default_storage from django.db.utils import IntegrityError, ProgrammingError -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.utils.decorators import method_decorator from django.db import connection from arches.app.utils.decorators import user_created_transaction_match diff --git a/arches/app/etl_modules/branch_csv_importer.py b/arches/app/etl_modules/branch_csv_importer.py index 34230bbe99a..787fb338cdf 100644 --- a/arches/app/etl_modules/branch_csv_importer.py +++ b/arches/app/etl_modules/branch_csv_importer.py @@ -10,7 +10,7 @@ from django.http import HttpResponse from openpyxl import load_workbook from django.db import connection -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.core.files.storage import default_storage from arches.app.datatypes.datatypes import DataTypeFactory from arches.app.models.models import Node diff --git a/arches/app/etl_modules/import_single_csv.py b/arches/app/etl_modules/import_single_csv.py index 938629a95a2..8d8c117f4dd 100644 --- a/arches/app/etl_modules/import_single_csv.py +++ b/arches/app/etl_modules/import_single_csv.py @@ -9,7 +9,7 @@ from django.core.files.storage import default_storage from django.db import connection from django.db.models.functions import Lower -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.datatypes.datatypes import DataTypeFactory from arches.app.models.models import GraphModel, Node, NodeGroup from arches.app.models.system_settings import settings diff --git a/arches/app/functions/primary_descriptors.py b/arches/app/functions/primary_descriptors.py index d734d5f9e7c..617173fc0cc 100644 --- a/arches/app/functions/primary_descriptors.py +++ b/arches/app/functions/primary_descriptors.py @@ -4,7 +4,7 @@ from arches.app.functions.base import BaseFunction from arches.app.models import models from arches.app.datatypes.datatypes import DataTypeFactory -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ logger = logging.getLogger(__name__) diff --git a/arches/app/models/concept.py b/arches/app/models/concept.py index 069fa586b30..4ce93ef3b8a 100644 --- a/arches/app/models/concept.py +++ b/arches/app/models/concept.py @@ -29,7 +29,7 @@ from arches.app.search.elasticsearch_dsl_builder import Term, Query, Bool, Match, Terms from arches.app.search.mappings import CONCEPTS_INDEX from arches.app.utils.betterJSONSerializer import JSONSerializer, JSONDeserializer -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.utils.translation import get_language from django.db import IntegrityError from psycopg2.extensions import AsIs diff --git a/arches/app/models/graph.py b/arches/app/models/graph.py index 96e294c9d0e..bc69836d761 100644 --- a/arches/app/models/graph.py +++ b/arches/app/models/graph.py @@ -31,7 +31,7 @@ from arches.app.datatypes.datatypes import DataTypeFactory from arches.app.utils.betterJSONSerializer import JSONSerializer, JSONDeserializer from arches.app.search.search_engine_factory import SearchEngineFactory -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pyld.jsonld import compact, JsonLdError from django.db.models.base import Deferred from django.utils import translation diff --git a/arches/app/models/models.py b/arches/app/models/models.py index 9dbfef8738d..64544eaac68 100644 --- a/arches/app/models/models.py +++ b/arches/app/models/models.py @@ -27,7 +27,7 @@ from django.db.models.signals import post_delete, pre_save, post_save from django.dispatch import receiver from django.utils import translation -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.contrib.auth.models import User from django.contrib.auth.models import Group from django.contrib.contenttypes.models import ContentType diff --git a/arches/app/models/resource.py b/arches/app/models/resource.py index 89afb0f571c..af5daef6dea 100644 --- a/arches/app/models/resource.py +++ b/arches/app/models/resource.py @@ -26,7 +26,7 @@ from django.contrib.auth.models import User, Group from django.forms.models import model_to_dict from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.utils.translation import get_language from arches.app.models import models from arches.app.models.models import EditLog diff --git a/arches/app/models/tile.py b/arches/app/models/tile.py index 71bd7f057bd..51eb72ee26a 100644 --- a/arches/app/models/tile.py +++ b/arches/app/models/tile.py @@ -30,7 +30,7 @@ from django.db.models import Q from django.contrib.auth.models import User from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.models import models from arches.app.models.resource import Resource from arches.app.models.resource import EditLog diff --git a/arches/app/search/base_index.py b/arches/app/search/base_index.py index 4f057ce3471..90d508ac7be 100644 --- a/arches/app/search/base_index.py +++ b/arches/app/search/base_index.py @@ -1,6 +1,6 @@ import pyprind from datetime import datetime -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.models import models from arches.app.models.resource import Resource from arches.app.models.system_settings import settings diff --git a/arches/app/search/components/map_filter.py b/arches/app/search/components/map_filter.py index d664cfc5dd7..97b9234ce49 100644 --- a/arches/app/search/components/map_filter.py +++ b/arches/app/search/components/map_filter.py @@ -1,7 +1,7 @@ import logging from django.contrib.gis.geos import GEOSGeometry from django.db import connection -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.models.system_settings import settings from arches.app.utils.betterJSONSerializer import JSONSerializer, JSONDeserializer from arches.app.search.elasticsearch_dsl_builder import Bool, Nested, Terms, GeoShape diff --git a/arches/app/search/elasticsearch_dsl_builder.py b/arches/app/search/elasticsearch_dsl_builder.py index 1ec9fe34d91..a179435b288 100644 --- a/arches/app/search/elasticsearch_dsl_builder.py +++ b/arches/app/search/elasticsearch_dsl_builder.py @@ -17,7 +17,7 @@ """ from arches.app.utils.betterJSONSerializer import JSONSerializer -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ class Dsl(object): diff --git a/arches/app/search/search_export.py b/arches/app/search/search_export.py index 9639edd827a..6cfaaa29be1 100644 --- a/arches/app/search/search_export.py +++ b/arches/app/search/search_export.py @@ -25,7 +25,7 @@ import re from django.contrib.gis.geos import GeometryCollection, GEOSGeometry from django.core.files import File -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.urls import reverse from arches.app.models import models from arches.app.models.system_settings import settings diff --git a/arches/app/tasks.py b/arches/app/tasks.py index 5b29d3df5c6..ef43d7c9d86 100644 --- a/arches/app/tasks.py +++ b/arches/app/tasks.py @@ -9,7 +9,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.http import HttpRequest -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.models import models from arches.app.utils import import_class_from_string from tempfile import NamedTemporaryFile diff --git a/arches/app/utils/data_management/resources/formats/csvfile.py b/arches/app/utils/data_management/resources/formats/csvfile.py index 3e2e773943f..9abc5e38c7a 100644 --- a/arches/app/utils/data_management/resources/formats/csvfile.py +++ b/arches/app/utils/data_management/resources/formats/csvfile.py @@ -35,7 +35,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.db import transaction from django.db.models import Q -from django.utils.translation import ugettext as _, get_language +from django.utils.translation import gettext as _, get_language logger = logging.getLogger(__name__) diff --git a/arches/app/utils/data_management/resources/formats/format.py b/arches/app/utils/data_management/resources/formats/format.py index ae192befe78..b4cc2260d80 100644 --- a/arches/app/utils/data_management/resources/formats/format.py +++ b/arches/app/utils/data_management/resources/formats/format.py @@ -16,7 +16,7 @@ from django.contrib.gis.geos import MultiPolygon from django.contrib.gis.geos import MultiLineString from django.db import connection, transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ class MissingGraphException(Exception): diff --git a/arches/app/utils/data_management/sparql_providers/aat_provider.py b/arches/app/utils/data_management/sparql_providers/aat_provider.py index 4fd709ad20a..b8990c05ec6 100644 --- a/arches/app/utils/data_management/sparql_providers/aat_provider.py +++ b/arches/app/utils/data_management/sparql_providers/aat_provider.py @@ -17,7 +17,7 @@ """ import urllib.request, urllib.error, urllib.parse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.models.models import DValueType from arches.app.models.concept import Concept, ConceptValue from arches.app.models.system_settings import settings diff --git a/arches/app/utils/forms.py b/arches/app/utils/forms.py index 4c7ba4c94d2..63c10d5c52a 100644 --- a/arches/app/utils/forms.py +++ b/arches/app/utils/forms.py @@ -21,7 +21,7 @@ from django.contrib.auth.models import User from django.db import transaction from django.forms.widgets import PasswordInput, TextInput -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.models import models from captcha.fields import ReCaptchaField import logging diff --git a/arches/app/utils/middleware.py b/arches/app/utils/middleware.py index 334b0d31b4a..96c05145f46 100644 --- a/arches/app/utils/middleware.py +++ b/arches/app/utils/middleware.py @@ -4,7 +4,7 @@ from django.contrib.auth.models import User, AnonymousUser from django.utils.deprecation import MiddlewareMixin from django.utils.functional import SimpleLazyObject -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.models.system_settings import settings from arches.app.utils.response import Http401Response from arches.app.utils.betterJSONSerializer import JSONSerializer, JSONDeserializer diff --git a/arches/app/utils/response.py b/arches/app/utils/response.py index 4934c08338b..ea6fcc62c01 100644 --- a/arches/app/utils/response.py +++ b/arches/app/utils/response.py @@ -1,7 +1,7 @@ from io import StringIO import logging from django.http import HttpResponse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.utils.betterJSONSerializer import JSONSerializer from arches.app.models.system_settings import settings diff --git a/arches/app/utils/task_management.py b/arches/app/utils/task_management.py index f31d0d4e414..e3c0845c193 100644 --- a/arches/app/utils/task_management.py +++ b/arches/app/utils/task_management.py @@ -1,6 +1,6 @@ import logging from kombu import Connection -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.models.system_settings import settings from arches.celery import app import time diff --git a/arches/app/views/api.py b/arches/app/views/api.py index 954dcf20cba..67d9f7112c6 100644 --- a/arches/app/views/api.py +++ b/arches/app/views/api.py @@ -26,7 +26,7 @@ from django.core.cache import cache from django.forms.models import model_to_dict from django.urls import reverse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.core.files.base import ContentFile from django.views.decorators.csrf import csrf_exempt from django.utils.decorators import method_decorator diff --git a/arches/app/views/auth.py b/arches/app/views/auth.py index ce4839aaac8..4dbe47cb84a 100644 --- a/arches/app/views/auth.py +++ b/arches/app/views/auth.py @@ -34,7 +34,7 @@ from django.views.decorators.cache import never_cache from django.views.decorators.csrf import csrf_exempt from django.utils.html import strip_tags -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.utils.http import urlencode from django.core.mail import EmailMultiAlternatives from django.urls import reverse diff --git a/arches/app/views/concept.py b/arches/app/views/concept.py index 31c2ef8e440..1ae7f6057ac 100644 --- a/arches/app/views/concept.py +++ b/arches/app/views/concept.py @@ -23,7 +23,7 @@ from django.shortcuts import render from django.utils.decorators import method_decorator from django.utils.module_loading import import_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.utils.translation import get_language from arches.app.models import models from arches.app.models.system_settings import settings diff --git a/arches/app/views/etl_manager.py b/arches/app/views/etl_manager.py index f9375a0df6e..c8f8c046648 100644 --- a/arches/app/views/etl_manager.py +++ b/arches/app/views/etl_manager.py @@ -5,7 +5,7 @@ from django.core.paginator import Paginator from django.forms.models import model_to_dict from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.http import HttpResponse from django.views.generic import View from arches.app.models.models import ETLModule, LoadEvent, LoadStaging diff --git a/arches/app/views/graph.py b/arches/app/views/graph.py index ffdef83fe39..1255aaa8f5d 100644 --- a/arches/app/views/graph.py +++ b/arches/app/views/graph.py @@ -24,7 +24,7 @@ from django.db import transaction from django.shortcuts import redirect, render from django.db.models import Q -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.utils.decorators import method_decorator from django.http import HttpResponseNotFound, HttpResponse from django.views.generic import View, TemplateView diff --git a/arches/app/views/language.py b/arches/app/views/language.py index 53ec0a94163..079e7d14e17 100644 --- a/arches/app/views/language.py +++ b/arches/app/views/language.py @@ -23,7 +23,7 @@ from arches.app.utils.response import JSONResponse from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.views.generic import View from arches.app.utils.betterJSONSerializer import JSONSerializer diff --git a/arches/app/views/manifest_manager.py b/arches/app/views/manifest_manager.py index f85935e0e58..5d031d1f93e 100644 --- a/arches/app/views/manifest_manager.py +++ b/arches/app/views/manifest_manager.py @@ -7,7 +7,7 @@ from revproxy.views import ProxyView from django.core.files.storage import default_storage from django.http import HttpRequest -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.views.generic import View from arches.app.utils.response import JSONResponse, JSONErrorResponse from arches.app.models import models diff --git a/arches/app/views/map.py b/arches/app/views/map.py index b56dc591bc4..3eca63c7654 100644 --- a/arches/app/views/map.py +++ b/arches/app/views/map.py @@ -18,7 +18,7 @@ from django.db import transaction from django.shortcuts import render from django.http import Http404 -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.utils.decorators import method_decorator from guardian.shortcuts import get_users_with_perms, get_groups_with_perms from revproxy.views import ProxyView diff --git a/arches/app/views/plugin.py b/arches/app/views/plugin.py index ad671941dea..b5f00fdc86d 100644 --- a/arches/app/views/plugin.py +++ b/arches/app/views/plugin.py @@ -17,7 +17,7 @@ """ from django.shortcuts import render, redirect -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from arches.app.models import models from arches.app.models.system_settings import settings from arches.app.utils.betterJSONSerializer import JSONSerializer diff --git a/arches/app/views/resource.py b/arches/app/views/resource.py index e5250f30d5d..02ee5505e3c 100644 --- a/arches/app/views/resource.py +++ b/arches/app/views/resource.py @@ -33,7 +33,7 @@ from django.template.loader import render_to_string from django.urls import reverse from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.views.generic import View from django.utils import translation diff --git a/arches/app/views/search.py b/arches/app/views/search.py index 2c8860e501d..c6dbeb11f69 100644 --- a/arches/app/views/search.py +++ b/arches/app/views/search.py @@ -27,7 +27,7 @@ from django.db import connection from django.http import HttpResponseNotFound from django.shortcuts import render -from django.utils.translation import get_language, ugettext as _ +from django.utils.translation import get_language, gettext as _ from django.utils.decorators import method_decorator from arches.app.models import models from arches.app.models.concept import Concept diff --git a/arches/app/views/tile.py b/arches/app/views/tile.py index f1efd6d3b56..751b0f6f861 100644 --- a/arches/app/views/tile.py +++ b/arches/app/views/tile.py @@ -34,7 +34,7 @@ from django.contrib.auth.models import User from django.http import HttpResponseNotFound, HttpResponseBadRequest from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.core.exceptions import ValidationError, ObjectDoesNotExist from django.views.generic import View from django.db import transaction diff --git a/arches/app/views/user.py b/arches/app/views/user.py index aa95ea3db1e..2d2798f26f3 100644 --- a/arches/app/views/user.py +++ b/arches/app/views/user.py @@ -23,7 +23,7 @@ import django.contrib.auth.password_validation as validation from django.shortcuts import render from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.views.generic import View from arches.app.models import models from arches.app.models.card import Card diff --git a/arches/management/commands/load_ontology.py b/arches/management/commands/load_ontology.py index aa02f5e4047..992b9a0b09d 100644 --- a/arches/management/commands/load_ontology.py +++ b/arches/management/commands/load_ontology.py @@ -22,7 +22,7 @@ import os import uuid import shutil -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.core.management.base import BaseCommand, CommandError from django.core.files import File from django.db import transaction From d0e240f6237054cc456f60fdd38876dba32fb066 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 25 Jul 2023 16:36:08 -0400 Subject: [PATCH 02/24] Replace deprecated url() with re_path() or path() Update arches project template to use path() --- .../arches-templates/project_name/urls.py-tpl | 4 +- arches/urls.py | 320 +++++++++--------- 2 files changed, 162 insertions(+), 162 deletions(-) diff --git a/arches/install/arches-templates/project_name/urls.py-tpl b/arches/install/arches-templates/project_name/urls.py-tpl index 92333d226fb..46a478cd63a 100644 --- a/arches/install/arches-templates/project_name/urls.py-tpl +++ b/arches/install/arches-templates/project_name/urls.py-tpl @@ -1,10 +1,10 @@ -from django.conf.urls import include, url from django.conf import settings from django.conf.urls.static import static from django.conf.urls.i18n import i18n_patterns +from django.urls import include, path urlpatterns = [ - url(r'^', include('arches.urls')), + path('', include('arches.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # if settings.SHOW_LANGUAGE_SWITCH is True: diff --git a/arches/urls.py b/arches/urls.py index 72c5f13ebca..dd9e4c283f8 100644 --- a/arches/urls.py +++ b/arches/urls.py @@ -19,8 +19,8 @@ from arches.app.views.language import LanguageView from django.views.decorators.cache import cache_page from django.contrib.auth import views as auth_views -from django.conf.urls import include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.urls import include, path, re_path from arches.app.views import concept, main, map, search, graph, api from arches.app.views.admin import ReIndexResources, FileView, ClearUserPermissionCache from arches.app.views.etl_manager import ETLManagerView @@ -88,49 +88,49 @@ urlpatterns = [ - url(r"^$", main.index, name="root"), - url(r"^index.htm", main.index, name="home"), - url(r"^auth/password$", ChangePasswordView.as_view(), name="change_password"), - url(r"^auth/signup$", SignupView.as_view(), name="signup"), - url(r"^auth/confirm_signup$", ConfirmSignupView.as_view(), name="confirm_signup"), - url(r"^auth/get_client_id$", GetClientIdView.as_view(), name="get_client_id"), - url(r"^auth/user_profile$", UserProfileView.as_view(), name="user_profile"), - url(r"^auth/server_settings$", ServerSettingView.as_view(), name="server_settings"), - url(r"^auth/get_dev_token$", Token.as_view(), name="get_dev_token"), - url(r"^auth/eoauth_cb$", ExternalOauth.callback, name="external_oauth_callback"), - url(r"^auth/eoauth_start$", ExternalOauth.start, name="external_oauth_start"), - url(r"^auth/", LoginView.as_view(), name="auth"), - url(r"^rdm/(?P%s|())$" % uuid_regex, RDMView.as_view(), name="rdm"), - url(r"^admin/reindex/resources$", ReIndexResources.as_view(), name="reindex"), - url(r"^files/(?P%s)$" % uuid_regex, FileView.as_view(), name="file_access"), - url(r"^concepts/(?P%s)/manage_parents/$" % uuid_regex, concept.manage_parents, name="concept_manage_parents"), - url(r"^concepts/(?P%s)/confirm_delete/$" % uuid_regex, concept.confirm_delete, name="confirm_delete"), - url(r"^concepts/(?P%s)/make_collection/$" % uuid_regex, concept.make_collection, name="make_collection"), - url(r"^concepts/(?P%s|())$" % uuid_regex, concept.concept, name="concept"), - url(r"^concepts/tree/(?P.*)", concept.concept_tree, name="concept_tree"), - url(r"^concepts/search$", concept.search, name="concept_search"), - url( + re_path(r"^$", main.index, name="root"), + re_path(r"^index.htm", main.index, name="home"), + re_path(r"^auth/password$", ChangePasswordView.as_view(), name="change_password"), + re_path(r"^auth/signup$", SignupView.as_view(), name="signup"), + re_path(r"^auth/confirm_signup$", ConfirmSignupView.as_view(), name="confirm_signup"), + re_path(r"^auth/get_client_id$", GetClientIdView.as_view(), name="get_client_id"), + re_path(r"^auth/user_profile$", UserProfileView.as_view(), name="user_profile"), + re_path(r"^auth/server_settings$", ServerSettingView.as_view(), name="server_settings"), + re_path(r"^auth/get_dev_token$", Token.as_view(), name="get_dev_token"), + re_path(r"^auth/eoauth_cb$", ExternalOauth.callback, name="external_oauth_callback"), + re_path(r"^auth/eoauth_start$", ExternalOauth.start, name="external_oauth_start"), + re_path(r"^auth/", LoginView.as_view(), name="auth"), + re_path(r"^rdm/(?P%s|())$" % uuid_regex, RDMView.as_view(), name="rdm"), + re_path(r"^admin/reindex/resources$", ReIndexResources.as_view(), name="reindex"), + re_path(r"^files/(?P%s)$" % uuid_regex, FileView.as_view(), name="file_access"), + re_path(r"^concepts/(?P%s)/manage_parents/$" % uuid_regex, concept.manage_parents, name="concept_manage_parents"), + re_path(r"^concepts/(?P%s)/confirm_delete/$" % uuid_regex, concept.confirm_delete, name="confirm_delete"), + re_path(r"^concepts/(?P%s)/make_collection/$" % uuid_regex, concept.make_collection, name="make_collection"), + re_path(r"^concepts/(?P%s|())$" % uuid_regex, concept.concept, name="concept"), + re_path(r"^concepts/tree/(?P.*)", concept.concept_tree, name="concept_tree"), + re_path(r"^concepts/search$", concept.search, name="concept_search"), + re_path( r"^concepts/(?P%s)/from_sparql_endpoint$" % uuid_regex, concept.add_concepts_from_sparql_endpoint, name="from_sparql_endpoint", ), - url(r"^concepts/search_sparql_endpoint$", concept.search_sparql_endpoint_for_concepts, name="search_sparql_endpoint"), - url(r"^concepts/dropdown", concept.dropdown, name="dropdown"), - url(r"^concepts/paged_dropdown", concept.paged_dropdown, name="paged_dropdown"), - url(r"^concepts/export/(?P%s)$" % uuid_regex, concept.export, name="export_concept"), - url(r"^concepts/export/collections", concept.export_collections, name="export_concept_collections"), - url(r"^concepts/collections", concept.get_concept_collections, name="get_concept_collections"), - url(r"^concepts/get_pref_label", concept.get_pref_label, name="get_pref_label"), - url(r"^conceptvalue/", concept.concept_value, name="concept_value"), - url(r"^search$", search.SearchView.as_view(), name="search_home"), - url(r"^search/terms$", search.search_terms, name="search_terms"), - url(r"^search/resources$", search.search_results, name="search_results"), - url(r"^search/time_wheel_config$", search.time_wheel_config, name="time_wheel_config"), - url(r"^search/export_results$", search.export_results, name="export_results"), - url(r"^search/get_export_file$", search.get_export_file, name="get_export_file"), - url(r"^search/get_dsl$", search.get_dsl_from_search_string, name="get_dsl"), - url(r"^buffer/$", search.buffer, name="buffer"), - url( + re_path(r"^concepts/search_sparql_endpoint$", concept.search_sparql_endpoint_for_concepts, name="search_sparql_endpoint"), + re_path(r"^concepts/dropdown", concept.dropdown, name="dropdown"), + re_path(r"^concepts/paged_dropdown", concept.paged_dropdown, name="paged_dropdown"), + re_path(r"^concepts/export/(?P%s)$" % uuid_regex, concept.export, name="export_concept"), + re_path(r"^concepts/export/collections", concept.export_collections, name="export_concept_collections"), + re_path(r"^concepts/collections", concept.get_concept_collections, name="get_concept_collections"), + re_path(r"^concepts/get_pref_label", concept.get_pref_label, name="get_pref_label"), + re_path(r"^conceptvalue/", concept.concept_value, name="concept_value"), + re_path(r"^search$", search.SearchView.as_view(), name="search_home"), + re_path(r"^search/terms$", search.search_terms, name="search_terms"), + re_path(r"^search/resources$", search.search_results, name="search_results"), + re_path(r"^search/time_wheel_config$", search.time_wheel_config, name="time_wheel_config"), + re_path(r"^search/export_results$", search.export_results, name="export_results"), + re_path(r"^search/get_export_file$", search.get_export_file, name="get_export_file"), + re_path(r"^search/get_dsl$", search.get_dsl_from_search_string, name="get_dsl"), + re_path(r"^buffer/$", search.buffer, name="buffer"), + re_path( r"^settings/", ResourceEditorView.as_view(), { @@ -141,170 +141,170 @@ }, name="config", ), - url(r"^graph/new$", GraphDataView.as_view(action="new_graph"), name="new_graph"), - url(r"^graph/import/", GraphDataView.as_view(action="import_graph"), name="import_graph"), - url(r"^graph/reorder_nodes$", GraphDataView.as_view(action="reorder_nodes"), name="reorder_nodes"), - url(r"^graph/permissions$", PermissionDataView.as_view(), name="permission_data"), - url(r"^resource/permissions$", ResourcePermissionDataView.as_view(), name="resource_permission_data"), - url( + re_path(r"^graph/new$", GraphDataView.as_view(action="new_graph"), name="new_graph"), + re_path(r"^graph/import/", GraphDataView.as_view(action="import_graph"), name="import_graph"), + re_path(r"^graph/reorder_nodes$", GraphDataView.as_view(action="reorder_nodes"), name="reorder_nodes"), + re_path(r"^graph/permissions$", PermissionDataView.as_view(), name="permission_data"), + re_path(r"^resource/permissions$", ResourcePermissionDataView.as_view(), name="resource_permission_data"), + re_path( r"^graph/permissions/permission_manager_data$", PermissionDataView.as_view(action="get_permission_manager_data"), name="permission_manager_data", ), - url(r"^graph/(?P%s|())$" % uuid_regex, GraphManagerView.as_view(), name="graph"), - url(r"^graph/(?P%s)/nodes$" % uuid_regex, GraphDataView.as_view(action="get_nodes"), name="graph_nodes"), - url(r"^graph/(?P%s)/append_branch$" % uuid_regex, GraphDataView.as_view(action="append_branch"), name="append_branch"), - url(r"^graph/(?P%s)/append_node$" % uuid_regex, GraphDataView.as_view(action="append_node"), name="append_node"), - url(r"^graph/(?P%s)/move_node$" % uuid_regex, GraphDataView.as_view(action="move_node"), name="move_node"), - url(r"^graph/(?P%s)/update_node$" % uuid_regex, GraphDataView.as_view(action="update_node"), name="update_node"), - url(r"^graph/(?P%s)/delete_node$" % uuid_regex, GraphDataView.as_view(action="delete_node"), name="delete_node"), - url( + re_path(r"^graph/(?P%s|())$" % uuid_regex, GraphManagerView.as_view(), name="graph"), + re_path(r"^graph/(?P%s)/nodes$" % uuid_regex, GraphDataView.as_view(action="get_nodes"), name="graph_nodes"), + re_path(r"^graph/(?P%s)/append_branch$" % uuid_regex, GraphDataView.as_view(action="append_branch"), name="append_branch"), + re_path(r"^graph/(?P%s)/append_node$" % uuid_regex, GraphDataView.as_view(action="append_node"), name="append_node"), + re_path(r"^graph/(?P%s)/move_node$" % uuid_regex, GraphDataView.as_view(action="move_node"), name="move_node"), + re_path(r"^graph/(?P%s)/update_node$" % uuid_regex, GraphDataView.as_view(action="update_node"), name="update_node"), + re_path(r"^graph/(?P%s)/delete_node$" % uuid_regex, GraphDataView.as_view(action="delete_node"), name="delete_node"), + re_path( r"^graph/(?P%s)/delete_instances$" % uuid_regex, GraphDataView.as_view(action="delete_instances"), name="delete_instances" ), - url(r"^graph/(?P%s)/clone$" % uuid_regex, GraphDataView.as_view(action="clone_graph"), name="clone_graph"), - url(r"^graph/(?P%s)/export$" % uuid_regex, GraphDataView.as_view(action="export_graph"), name="export_graph"), - url(r"^graph/(?P%s)/delete$" % uuid_regex, GraphDataView.as_view(action="delete_graph"), name="delete_graph"), - url(r"^graph/(?P%s)/export_branch$" % uuid_regex, GraphDataView.as_view(action="export_branch"), name="export_branch"), - url( + re_path(r"^graph/(?P%s)/clone$" % uuid_regex, GraphDataView.as_view(action="clone_graph"), name="clone_graph"), + re_path(r"^graph/(?P%s)/export$" % uuid_regex, GraphDataView.as_view(action="export_graph"), name="export_graph"), + re_path(r"^graph/(?P%s)/delete$" % uuid_regex, GraphDataView.as_view(action="delete_graph"), name="delete_graph"), + re_path(r"^graph/(?P%s)/export_branch$" % uuid_regex, GraphDataView.as_view(action="export_branch"), name="export_branch"), + re_path( r"^graph/(?P%s)/export_mapping_file$" % uuid_regex, GraphDataView.as_view(action="export_mapping_file"), name="export_mapping_file", ), - url( + re_path( r"^graph/(?P%s)/get_related_nodes/(?P%s)$" % (uuid_regex, uuid_regex), GraphDataView.as_view(action="get_related_nodes"), name="get_related_nodes", ), - url( + re_path( r"^graph/(?P%s)/get_valid_domain_nodes/(?P%s|())$" % (uuid_regex, uuid_regex), GraphDataView.as_view(action="get_valid_domain_nodes"), name="get_valid_domain_nodes", ), - url( + re_path( r"^graph/(?P%s)/get_domain_connections$" % uuid_regex, GraphDataView.as_view(action="get_domain_connections"), name="get_domain_connections", ), - url(r"^graph/(?P%s)/publish$" % uuid_regex, GraphPublicationView.as_view(action="publish"), name="publish_graph"), - url(r"^graph/(?P%s)/unpublish$" % uuid_regex, GraphPublicationView.as_view(action="unpublish"), name="unpublish_graph"), - url(r"^graph/(?P%s)/function_manager$" % uuid_regex, FunctionManagerView.as_view(), name="function_manager"), - url(r"^graph/(?P%s)/apply_functions$" % uuid_regex, FunctionManagerView.as_view(), name="apply_functions"), - url(r"^graph/(?P%s)/remove_functions$" % uuid_regex, FunctionManagerView.as_view(), name="remove_functions"), - url(r"^graph_designer/(?P%s)$" % uuid_regex, GraphDesignerView.as_view(), name="graph_designer"), - url(r"^graph_settings/(?P%s)$" % uuid_regex, GraphSettingsView.as_view(), name="graph_settings"), - url(r"^components/datatypes/(?P