Django
1
Вклад в тег
text_list = []
for line in some_file:
text_list.append(line)
new_text = Text.objects.create(text=text_list)
def upload_private_chat(request):
fs = FileSystemStorage(location='./media/message_image')
myfile = request.FILES.get('image_message')
print(myfile)
filename = fs.save(myfile.name, myfile)
uploaded_file_url = fs.url(filename)
return HttpResponse( uploaded_file_url)