Ejemplo n.º 1
0
def dwon_stl(request):
    '''
    #预览STL文件 进行下载步骤
    '''
    _url = request.POST['_url']
    stl_path = good_filter.down_stl(_url)
    context = {'stl_path': stl_path}
    return HttpResponse(json.dumps(context))
Ejemplo n.º 2
0
def show_3d(request):

    id = request.POST['pic_id']
    state = request.POST['unpassed']
    #pdb.set_trace()
    if state == 'unpassed':
        stl_path = Goods_Upload.objects.get(id=id).stl_path
        _url = (server_website.file_server_path) + (stl_path)
    else:
        stl_path = Goods.objects.get(id=id).stl_path
        _url = str(server_website.file_server_path) + str(stl_path)
    url_path = good_filter.down_stl(_url)
    if server_website.is_local_server:
        url_path = url_path.split('/')[-1]
        url_path = server_website.stl_local + url_path
    if not ip_address.in_test_server:
        url_path = url_path.split('/')[-1]
        url_path = server_website.stl_3dlove + url_path
    print url_path
    conf = {'url_path': url_path}
    return HttpResponse(json.dumps(conf))
Ejemplo n.º 3
0
def show_3d(request):

    id = request.POST["pic_id"]
    state = request.POST["unpassed"]
    # pdb.set_trace()
    if state == "unpassed":
        stl_path = Goods_Upload.objects.get(id=id).stl_path
        _url = (server_website.file_server_path) + (stl_path)
    else:
        stl_path = Goods.objects.get(id=id).stl_path
        _url = str(server_website.file_server_path) + str(stl_path)
    url_path = good_filter.down_stl(_url)
    if server_website.is_local_server:
        url_path = url_path.split("/")[-1]
        url_path = server_website.stl_local + url_path
    if not ip_address.in_test_server:
        url_path = url_path.split("/")[-1]
        url_path = server_website.stl_3dlove + url_path
    print url_path
    conf = {"url_path": url_path}
    return HttpResponse(json.dumps(conf))