-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from charleszlu/master
Fix Django 4.0 deprecations
- Loading branch information
Showing
8 changed files
with
25 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
"""example_app URL Configuration | ||
The `urlpatterns` list routes URLs to views. For more information please see: | ||
https://docs.djangoproject.com/en/1.8/topics/http/urls/ | ||
https://docs.djangoproject.com/en/stable/topics/http/urls/ | ||
Examples: | ||
Function views | ||
1. Add an import: from my_app import views | ||
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') | ||
2. Add a URL to urlpatterns: path('', views.home, name='home') | ||
Class-based views | ||
1. Add an import: from other_app.views import Home | ||
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') | ||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') | ||
Including another URLconf | ||
1. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) | ||
1. Add a URL to urlpatterns: path('blog/', include('blog.urls')) | ||
""" | ||
from django.conf.urls import include, url | ||
from django.urls import include, path | ||
from django.contrib import admin | ||
|
||
urlpatterns = [ | ||
url(r'^taggit/', include('taggit_selectize.urls')), | ||
url(r'^admin/', include(admin.site.urls)), | ||
path('taggit/', include('taggit_selectize.urls')), | ||
path('admin/', include(admin.site.urls)), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
django>=1.8.8 | ||
django>=2.2 | ||
django-taggit>=0.18.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
'tests', | ||
], | ||
MIDDLEWARE_CLASSES=[], | ||
ROOT_URLCONF='taggit_selectize.urls', | ||
) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from django.conf.urls import * | ||
from django.urls import path | ||
|
||
from .views import get_tags_recommendation | ||
|
||
urlpatterns = [ | ||
url(r'^$', get_tags_recommendation, name='tags_recommendation'), | ||
path('', get_tags_recommendation, name='tags_recommendation'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.test import TestCase | ||
from django.urls import reverse | ||
|
||
|
||
class TestUrls(TestCase): | ||
def test_urls(self): | ||
response = self.client.get(reverse('tags_recommendation')) | ||
self.assertEqual(response.status_code, 200) | ||
self.assertEqual(response.request['PATH_INFO'], '/') |