Простая страница upload файлов, локально все работает но как только загружу на сервер не выводит кнопку выбора файлов.
Локально
Сервер
views
from django.views.generic.edit import FormView
from .forms import FileFieldForm
from django.shortcuts import render
from django.conf import settings
from django.core.files.storage import FileSystemStorage
import paramiko
import glob
import os
from .models import Analiticks
class FileFieldView(FormView):
form_class = FileFieldForm
template_name = 'mainpage/upload.html'
success_url = 'analize'
def post(self, request, *args, **kwargs):
form_class = self.get_form_class()
form = self.get_form(form_class)
files = request.FILES.getlist('attachments')
if form.is_valid():
filesystem = FileSystemStorage()
for f in files:
pass
filename = filesystem.save(f.name, f)
return self.form_valid(form)
else:
return self.form_invalid(form)
forms
class FileFieldForm(forms.Form):
attachments = forms.FileField(widget=forms.ClearableFileInput(attrs={'multiple': True}))
upload.html
<form enctype="multipart/form-data" method="post">
{% csrf_token %}
{{ form.attachments }}
<button type="submit">Анализировать</button>
</form>