slim icon indicating copy to clipboard operation
slim copied to clipboard

如何解决跨域问题,该如何编写配置文件

Open 1980744819 opened this issue 6 years ago • 4 comments

1980744819 avatar Jan 03 '19 16:01 1980744819

Application的cors选项: CORS_OPTIONS = CORSOptions('', allow_credentials=True, expose_headers='', allow_headers='*')

fy0 avatar Jan 04 '19 01:01 fy0

应用于icarus项目中的时候: CORS_OPTIONS = CORSOptions('', allow_credentials=True, expose_headers='', allow_headers='*')

并不管用... 附截图: image

guzhenping avatar Jan 14 '19 08:01 guzhenping

应用于icarus项目中的时候: CORS_OPTIONS = CORSOptions('', allow_credentials=True, expose_headers='', allow_headers='*')

并不管用... 附截图: image

这种问题的出现是因为config.py或者private.py文件的host需要改为如下:

HOST = '0.0.0.0'

(TMD,好羞耻,看了半天才发现,一直怀疑slim这个新框架...逃...

guzhenping avatar Jan 14 '19 08:01 guzhenping

呃 回头我写一下config.py的内容将被private.py所覆盖这件事

fy0 avatar Jan 14 '19 17:01 fy0