Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
fix: upgrade django42
Browse files Browse the repository at this point in the history
  • Loading branch information
zubairshakoorarbisoft committed Oct 6, 2023
1 parent 35c4016 commit 4bdef90
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 23 deletions.
7 changes: 4 additions & 3 deletions analytics_data_api/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from django.urls import include, re_path
from django.urls import path
from django.urls import include
from rest_framework.urlpatterns import format_suffix_patterns

app_name = 'analytics_data_api'

urlpatterns = [
re_path(r'^v0/', include('analytics_data_api.v0.urls')),
re_path(r'^v1/', include('analytics_data_api.v1.urls')),
path('v0/', include('analytics_data_api.v0.urls')),
path('v1/', include('analytics_data_api.v1.urls')),
]

urlpatterns = format_suffix_patterns(urlpatterns)
4 changes: 2 additions & 2 deletions analytics_data_api/v0/urls/course_summaries.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.urls import re_path
from django.urls import path

from analytics_data_api.v0.views import course_summaries as views

app_name = 'course_summaries'

urlpatterns = [
re_path(r'^course_summaries/$', views.CourseSummariesView.as_view(), name='course_summaries'),
path('course_summaries/', views.CourseSummariesView.as_view(), name='course_summaries'),
]
3 changes: 2 additions & 1 deletion analytics_data_api/v0/urls/problems.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import re

from django.urls import path
from django.urls import re_path

from analytics_data_api.v0.views import problems as views
Expand All @@ -12,7 +13,7 @@
]

urlpatterns = [
re_path(r'^(?P<module_id>.+)/sequential_open_distribution/$',
path('<path:module_id>/sequential_open_distribution/',
views.SequentialOpenDistributionView.as_view(),
name='sequential_open_distribution'),
]
Expand Down
15 changes: 8 additions & 7 deletions analytics_data_api/v1/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.urls import path
from django.urls import include, re_path, reverse_lazy
from django.views.generic import RedirectView

Expand Down Expand Up @@ -28,13 +29,13 @@
course_urlpatterns.append(re_path(regex, view.as_view(), name=name))

urlpatterns = course_urlpatterns + [
re_path(r'^problems/', include('analytics_data_api.v0.urls.problems')),
re_path(r'^videos/', include('analytics_data_api.v0.urls.videos')),
re_path('^', include('analytics_data_api.v0.urls.course_summaries')),
re_path('^', include('analytics_data_api.v0.urls.programs')),
path('problems/', include('analytics_data_api.v0.urls.problems')),
path('videos/', include('analytics_data_api.v0.urls.videos')),
path('', include('analytics_data_api.v0.urls.course_summaries')),
path('', include('analytics_data_api.v0.urls.programs')),

# pylint: disable=no-value-for-parameter
re_path(r'^authenticated/$', RedirectView.as_view(url=reverse_lazy('authenticated')), name='authenticated'),
re_path(r'^health/$', RedirectView.as_view(url=reverse_lazy('health')), name='health'),
re_path(r'^status/$', RedirectView.as_view(url=reverse_lazy('status')), name='status'),
path('authenticated/', RedirectView.as_view(url=reverse_lazy('authenticated')), name='authenticated'),
path('health/', RedirectView.as_view(url=reverse_lazy('health')), name='health'),
path('status/', RedirectView.as_view(url=reverse_lazy('status')), name='status'),
]
17 changes: 9 additions & 8 deletions analyticsdataserver/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.contrib import admin
from django.urls import path
from django.urls import include, re_path
from django.views.generic import RedirectView
from edx_api_doc_tools import make_api_info, make_docs_ui_view
Expand All @@ -10,16 +11,16 @@
admin.site.site_title = admin.site.site_header

urlpatterns = [
re_path(r'^api-auth/', include('rest_framework.urls', 'rest_framework')),
path('api-auth/', include('rest_framework.urls', 'rest_framework')),
re_path(r'^api-token-auth/', obtain_auth_token),

re_path(r'^api/', include('analytics_data_api.urls')),
re_path(r'^status/$', views.StatusView.as_view(), name='status'),
re_path(r'^authenticated/$', views.AuthenticationTestView.as_view(), name='authenticated'),
re_path(r'^health/$', views.HealthView.as_view(), name='health'),
path('api/', include('analytics_data_api.urls')),
path('status/', views.StatusView.as_view(), name='status'),
path('authenticated/', views.AuthenticationTestView.as_view(), name='authenticated'),
path('health/', views.HealthView.as_view(), name='health'),
]

urlpatterns.append(re_path(r'', include('enterprise_data.urls')))
urlpatterns.append(path('', include('enterprise_data.urls')))

api_ui_view = make_docs_ui_view(
api_info=make_api_info(
Expand All @@ -31,8 +32,8 @@
)

urlpatterns += [
re_path(r'^docs/$', api_ui_view, name='api-docs'),
re_path(r'^$', RedirectView.as_view(url='/docs')), # pylint: disable=no-value-for-parameter
path('docs/', api_ui_view, name='api-docs'),
path('', RedirectView.as_view(url='/docs')), # pylint: disable=no-value-for-parameter
]

handler500 = 'analyticsdataserver.views.handle_internal_server_error' # pylint: disable=invalid-name
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
skipsdist = True
envlist = py38-django{32, 42}
envlist = py38-django{42}

[testenv]
passenv =
Expand All @@ -11,7 +11,6 @@ setenv =
NODE_BIN = ./node_modules/.bin
PATH = $PATH:$NODE_BIN
deps =
django32: Django>=3.2,<3.3
django42: Django>=4.2,<4.3
-r requirements/test.txt
commands =
Expand Down

0 comments on commit 4bdef90

Please sign in to comment.