我在本次研讨会之后构建了一个 Amplify 示例应用程序。之后,我手动删除了 CloudFormation 堆栈(从 AWS 控制台 - 选择根堆栈并执行删除堆栈操作),希望我可以使用amplify push. 不幸的是,放大报告没有变化,也不会重建堆栈。有没有办法强制放大来提供资源?
我在Django 2.2中使用与往常相同的命令启动一个新项目:
python3 -m venv django-env
. django-env/bin/activate
pip install django
django-admin startproject mysite
cd mysite/
python3 manage.py runserver 8080
Run Code Online (Sandbox Code Playgroud)
这应该会导致Django网站运行,准备编写一些代码。不幸的是,现在我遇到一个奇怪的错误:
LookupError: No installed app with label 'admin'.
完整回溯:
Watching for file changes with StatReloader
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/ec2-user/environment/django-env/lib64/python3.6/dist-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/home/ec2-user/environment/django-env/lib64/python3.6/dist-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/home/ec2-user/environment/django-env/lib64/python3.6/dist-packages/django/utils/autoreload.py", line 77, in raise_last_exception …Run Code Online (Sandbox Code Playgroud) 我正在尝试为 S3 文件夹(它本身包含更多文件夹/文件)生成一个预先签名的 url,并将其分发给我的客户,以便他们可以下载其内容。即通过单击链接,用户将文件夹下载到他们的本地磁盘。
但是,我在 XML 对话中不断收到“没有这样的键”错误。
我正在使用来自 boto3 sdk 的 client.generate_presigned_url()
def create_presigned_url(bucket, object):
try:
url = s3_client.generate_presigned_url(
'get_object',
Params={
'Bucket': bucket,
'Key': object
},
ExpiresIn=240,
HttpMethod='GET'
)
except ClientError as e:
print(e)
return None
return url
Run Code Online (Sandbox Code Playgroud)
这是错误消息:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>output/BARNES/070419/APR19BAR/</Key>
<RequestId>E6BE736FE945FA22</RequestId>
<HostId>
hk3+d+***********************************************************+EO2CZmo=
</HostId>
</Error>
Run Code Online (Sandbox Code Playgroud)