Ejemplo n.º 1
0
def pic_view(request, newname):
    file = File()
    fileobj = file.getfile_by_newname(newname)
    filename = fileobj.name
    filename_resize = filename.replace('img', 'img_resize')
    pic_path = os.path.join('/static', filename)
    pic_resize_path = os.path.join('/static', filename_resize)
    return render(request, 'pic_view.html', {'pic_path':pic_path, 'pic_resize_path':pic_resize_path})
Ejemplo n.º 2
0
def all_share(request):
    file_dict = {}
    file = File()
    files = file.getfile_all()
    for file in files:
        filename = file.filename.name
        file_dict[file] = filename.replace('img', 'img_resize')
    return render(request, 'my_share.html', {'file_dict': file_dict})
Ejemplo n.º 3
0
def all_share(request):
    file_dict={}
    file = File()
    files = file.getfile_all()
    for file in files:
        filename = file.filename.name
        file_dict[file] = filename.replace('img', 'img_resize')
    return render(request, 'my_share.html', {'file_dict':file_dict})
Ejemplo n.º 4
0
def pic_view(request, newname):
    file = File()
    fileobj = file.getfile_by_newname(newname)
    filename = fileobj.name
    filename_resize = filename.replace('img', 'img_resize')
    pic_path = os.path.join('/static', filename)
    pic_resize_path = os.path.join('/static', filename_resize)
    return render(request, 'pic_view.html', {
        'pic_path': pic_path,
        'pic_resize_path': pic_resize_path
    })