简体   繁体   English

Webfaction已被CORS策略阻止从来源“ http:// mydomain”访问domain / fonts / fontname.ext的字体:No'Access-Control-Allow-Origin'

[英]Webfaction Access to font at domain/fonts/fontname.ext from origin 'http://mydomain' has been blocked by CORS policy: No 'Access-Control-Allow-Origin'

I have django 2.1.5 with python3.7 app worket well on local... 我在本地上很好地使用Django3.7和Django3.7应用程式工作套件2.1.5 ...

I have create static app in my webfaction dashboard Static-Only (no .htaccess). 我在Webfaction仪表板“仅静态”(没有.htaccess)中创建了静态应用。 All work fine except certains fonts i have this message this error in my browser: 除某些字体外,其他所有工具都工作正常,我在浏览器中收到此错误消息:

Access to font at 在访问字体

' http://domain/static/plugins/elegant_font/html_css/fonts/ElegantIcons.woff ' from origin ' http://domain ' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 来源' http:// domain '的' http://domain/static/plugins/elegant_font/html_css/fonts/ElegantIcons.woff '被CORS策略阻止:不存在'Access-Control-Allow-Origin'标头在请求的资源上。 (index):942 GET http://domain/static/plugins/elegant_font/html_css/fonts/ElegantIcons.woff net::ERR_FAILED** (索引):942 GET http://domain/static/plugins/elegant_font/html_css/fonts/ElegantIcons.woff net :: ERR_FAILED **

How can i solved it i have trying many solution (django-cors-headers and others) But not work. 我该如何解决呢?我尝试了许多解决方案(django-cors-headers等),但没有用。 I need if possible step by step help ... 我需要逐步帮助...

I hope you solved your issue by now. 希望您现在解决了您的问题。

From my experience just make sure the webfaction static app is in the same website/domain group as your webfaction django/mod_wsgi app (like the screenshot below): 根据我的经验,请确保webfaction静态应用程序webfaction django / mod_wsgi应用程序位于同一网站/域组中(如以下屏幕截图所示):

Webfaction控制面板,带有独立静态和媒体应用程序的Django网站

I followed the following instructions from the Webfaction Documentation . 我遵循了Webfaction文档中的以下指示。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 CORS 策略已阻止来自原点“null”:请求的资源上不存在“Access-Control-Allow-Origin”header - From origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource Javascript XMLHttpRequest-已被CORS策略阻止:所请求的资源上不存在“ Access-Control-Allow-Origin”标头 - Javascript XMLHttpRequest - has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource 被 CORS 策略阻止:No"Access-Control-Allow-Origin" Using Flask - Blocked by CORS policy: No"Access-Control-Allow-Origin" Using Flask CORS 政策阻止了获取“url”的访问:请求的资源上不存在“Access-Control-Allow-Origin”header。 ReactJS - Access to fetch `url` been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. ReactJS Axios blocked by CORS policy with Django REST Framework: 'Access-Control-Allow-Origin' header in the response must not be wildcard - Axios blocked by CORS policy with Django REST Framework: 'Access-Control-Allow-Origin' header in the response must not be wildcard 由于没有 Access-Control-Allow-Origin 标头但标头存在而被 CORS 阻止的 HTTP 请求 - HTTP request blocked by CORS for not having Access-Control-Allow-Origin header but the header is present AngularJS HTTP POST无访问控制-允许起源CORS - AngularJS HTTP POST No Access-Control-Allow-Origin CORS Javascript 中的套接字 IO 错误:“访问 XMLHttpRequest 已被 Z5A8FEFF0B4BDE3BEEC9D924 阻止” - Socket IO error in Javascript: “Access to XMLHttpRequest from origin 'null' has been blocked by CORS policy” django & javascript fetch():CORS 政策:没有“访问控制允许来源”Z099FB995346F31C79E3ZF6 存在 - django & javascript fetch(): CORS policy: No 'Access-Control-Allow-Origin' header is present Django CORS Access-Control-Allow-Origin缺失 - Django CORS Access-Control-Allow-Origin missing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM