diff --git a/django_gcloud_storage/__init__.py b/django_gcloud_storage/__init__.py index 150a8bc..50af5be 100644 --- a/django_gcloud_storage/__init__.py +++ b/django_gcloud_storage/__init__.py @@ -14,7 +14,7 @@ from django.core.files.base import File from django.core.files.storage import Storage from django.utils.deconstruct import deconstructible -from django.utils.encoding import force_text, smart_str +from django.utils.encoding import force_str, smart_str from google.cloud import _helpers as gcloud_helpers from google.cloud import storage from google.cloud.exceptions import NotFound @@ -24,8 +24,8 @@ def safe_join(base, path): - base = force_text(base).replace("\\", "/").lstrip("/").rstrip("/") + "/" - path = force_text(path).replace("\\", "/").lstrip("/") + base = force_str(base).replace("\\", "/").lstrip("/").rstrip("/") + "/" + path = force_str(path).replace("\\", "/").lstrip("/") # Ugh... there must be a better way that I can't think of right now if base == "/": diff --git a/test_app/app/urls.py b/test_app/app/urls.py index 96fda97..5198e48 100644 --- a/test_app/app/urls.py +++ b/test_app/app/urls.py @@ -13,15 +13,15 @@ 1. Add an import: from blog import urls as blog_urls 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ -from django.conf.urls import url +from django.urls import re_path from django.views.generic.base import TemplateView from test_app.app import views urlpatterns = [ - url(r'^upload$', views.TestUploadView.as_view()), - url(r'^upload/success', + re_path(r'^upload$', views.TestUploadView.as_view()), + re_path(r'^upload/success', TemplateView.as_view(template_name="success.html"), name='upload_success'), - url(r'^file/(?P[0-9]+)$', views.file), + re_path(r'^file/(?P[0-9]+)$', views.file), ]