AWS ElasticBeanStalk如何与Django上传静态文件
我尝试上传staticfiles:
AWS:ElasticBeanStalk:Enviroment:proxy:staticfiles: /static: /static
此错误
2022-04-27 03:34:07 ERROR "option_settings" in one of the configuration files failed validation. More details to follow.
2022-04-27 03:34:07 ERROR Invalid option specification (Namespace: 'aws:elasticbeanstalk:enviroment:proxy:staticfiles', OptionName: '/static'): Unknown configuration setting.
2022-04-27 03:34:07 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
在我也只尝试执行
python manage.py collectstatic
且无效,
我以这种方式尝试了我的设置
STATIC_URL = '/static/'
STATIC_ROOT = 'static'
。
STATIC_URL = '/static/'
STATIC_ROOT = 'static'
STATICFILES_DIRS = [BASE_DIR / 'templates/static']
I tried uploading staticfiles:
aws:elasticbeanstalk:enviroment:proxy:staticfiles:
/static: /static
got this error in
2022-04-27 03:34:07 ERROR "option_settings" in one of the configuration files failed validation. More details to follow.
2022-04-27 03:34:07 ERROR Invalid option specification (Namespace: 'aws:elasticbeanstalk:enviroment:proxy:staticfiles', OptionName: '/static'): Unknown configuration setting.
2022-04-27 03:34:07 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
I also tried only doing
python manage.py collectstatic
and it did not work
I tried my settings.py in this way:
STATIC_URL = '/static/'
STATIC_ROOT = 'static'
and this way(current way im utilizing):
STATIC_URL = '/static/'
STATIC_ROOT = 'static'
STATICFILES_DIRS = [BASE_DIR / 'templates/static']
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试以下对我有用的配置。
settings.py
运行
python manage.py collect static
转到您的root urls.py,然后添加
您可以参考 github
You can try following configuration which worked for me.
settings.py
Run
python manage.py collect static
Go to your root urls.py and add
you can refer Github