mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
[py3] Updated urllib/urllib2/urlparse imports.
Lots of functions were moved. Use explicit imports in all cases to keey it easy to identify where the functions come from.
This commit is contained in:
@@ -9,7 +9,10 @@ import os
|
||||
import stat
|
||||
import posixpath
|
||||
import re
|
||||
import urllib
|
||||
try:
|
||||
from urllib.parse import unquote
|
||||
except ImportError: # Python 2
|
||||
from urllib import unquote
|
||||
|
||||
from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseNotModified
|
||||
from django.template import loader, Template, Context, TemplateDoesNotExist
|
||||
@@ -30,7 +33,7 @@ def serve(request, path, document_root=None, show_indexes=False):
|
||||
but if you'd like to override it, you can create a template called
|
||||
``static/directory_index.html``.
|
||||
"""
|
||||
path = posixpath.normpath(urllib.unquote(path))
|
||||
path = posixpath.normpath(unquote(path))
|
||||
path = path.lstrip('/')
|
||||
newpath = ''
|
||||
for part in path.split('/'):
|
||||
|
||||
Reference in New Issue
Block a user