Почему не работает DATA_UPLOAD_MAX_MEMORY_SIZE? Django, текстовое поле TinyMCE
У меня есть
DATA_UPLOAD_MAX_MEMORY_SIZE = 209_715_200
FILE_UPLOAD_MAX_MEMORY_SIZE = 209_715_200
в настройках. Однако, когда я пытаюсь добавить 5 изображений в текстовое поле tinymce (общий вес изображений > 2,5 мб), я получаю ошибку: Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
Как я могу это исправить?
settings.py
views.py:
def edit_post(request, slug):
post = get_object_or_404(Post, slug=slug)
if request.method == "POST":
form = PostForm(request.POST, instance=post)
if form.is_valid():
post.author = request.user.profile
post.createdDateTime = timezone.now()
if post.title != form.cleaned_data["title"]:
post.slug = unique_slugify(post.title.lower())
if "thumbnail" in request.FILES:
post.thumbnail = request.FILES["thumbnail"]
post.save()
return redirect('profile-details')
else:
form = PostForm(instance=post)
return render(request, 'portfolio/edit_post.html', {'form': form})
html template:
{% load static %}
{% block title %}
<head>
<link rel="stylesheet" href="{% static 'css/edit_post.css' %}">
<meta charset="UTF-8">
<title>Новая публикация</title>
<script src="{% static 'js/tinymce/tinymce.min.js' %}"></script>
<style>
input[type="checkbox"] {
transform: scale(1.2);
}
</style>
</head>
{% endblock title %}
{% block content %}
<head>
{{ form.media }}
</head>
<body class="text-center">
<div class="main-block justify-content-center text-center">
<form method="POST" class="post-form" enctype="multipart/form-data">
{% csrf_token %}
<div class="row header-box">
<div class="col">
<img src="/static/img/Union.svg" alt="плюсик" height="50" width="50" class="plus">
</div>
</div>
<div class="row title-box mb-4">
<p class="text-black mb-0"><input class="input-name-post text-center" type="text" value="{% if form.title.value != None %}{{ form.title.value }}{% endif %}" name="title" placeholder="Заголовок публикации" required minlength="5"></p>
</div>
<div class="row box-text">
{{ form.text }}
</div>
<div class="box-img">
<label for="formFileSm" class="form-label">Обложка для публикации</label>
<input class="form-control form-control-sm" id="formFileSm" type="file" name="thumbnail">
</div>
<div class="confirm">
<div class="form-check form-switch">
<label class="form-check-label" for="flexSwitchCheckDefault">
<input class="form-check-input" type="checkbox"
id="flexSwitchCheckDefault" name="isThisRegistration">Добавить регистрацию?</label>
</div>
<button type="submit" class="btn btn-info">Опубликовать</button>
</div>
</form>
</div>
</body>
{% endblock content %}```
i've added two lines to settings:``` DATA_UPLOAD_MAX_MEMORY_SIZE = 209_715_200
FILE_UPLOAD_MAX_MEMORY_SIZE = 209_715_200```