在python\Lib\site-packages\ckeditor_uploader下面找到views.py文件,修改成如下就可以了
from __future__ import absolute_import, unicode_literals
import inspect
import os
import warnings
import time #新增
import random #新增
from datetime import datetime
from django.conf import settings
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
from django.utils.html import escape
from django.utils.module_loading import import_string
from django.views import generic
from django.views.decorators.csrf import csrf_exempt
from ckeditor_uploader import utils
from ckeditor_uploader.backends import registry
from ckeditor_uploader.forms import SearchForm
from ckeditor_uploader.utils import storage
from .utils import is_valid_image_extension
def _get_user_path(user):
user_path = ''
# If CKEDITOR_RESTRICT_BY_USER is True upload file to user specific path.
RESTRICT_BY_USER = getattr(settings, 'CKEDITOR_RESTRICT_BY_USER', Fal