小编hor*_*erd的帖子

反应头盔未在视图页面源中显示元标记,但在检查元素中显示

我们有这个网站,我们使用这种方式在不同的页面中添加了元标记。

     <Helmet>
            <title>THIS IS TITLE</title>
            <meta
            name="description" 
            content="THIS IS CONTENT" />
        </Helmet>
Run Code Online (Sandbox Code Playgroud)

当我点击此页面的路线时,我看到标题发生了变化。我在元素中看到元标记,但我在查看页面源代码中没有看到该页面的元标记。出了什么问题,我们如何解决这个问题。根据我们的 seo专家,它应该出现在视图页面源中。注意:它是一个客户端渲染的应用程序。

javascript reactjs

4
推荐指数
1
解决办法
2433
查看次数

ValueError:将文件上传到 s3 存储桶时文件名必须是字符串

我正在邮递员中发送一个 excel 文件作为请求,并且需要将其上传到 s3 。我从请求访问该文件并将其发送到 s3。

@api_view(['POST'])
def excel_upload(request):
    print("request", request)
    excel_file = request.FILES['file'] 
    print("excel_file", excel_file) // this prints the name of the excel file i am sending in request
    upload_to_aws(excel_file,'X1excelsheets','s3_file_name')
Run Code Online (Sandbox Code Playgroud)

这是上传文件到 s3 的函数。

def upload_to_aws(local_file, bucket, s3_file):
    s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY,
                      aws_secret_access_key=SECRET_KEY)

    try:
        s3.upload_file(local_file, bucket, s3_file)
        print("Upload Successful")
        return True
    except FileNotFoundError:
        print("The file was not found")
        return False
    except NoCredentialsError:
        print("Credentials not available")
        return False


uploaded = upload_to_aws('local_file', 'bucket_name', 's3_file_name')
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用这个特定的帖子

https://medium.com/bilesanmiahmad/how-to-upload-a-file-to-amazon-s3-in-python-68757a1867c6
Run Code Online (Sandbox Code Playgroud)

把事情做好。错误:ValueError:文件名必须是字符串

python django amazon-s3 boto3

2
推荐指数
1
解决办法
8753
查看次数

标签 统计

amazon-s3 ×1

boto3 ×1

django ×1

javascript ×1

python ×1

reactjs ×1