On our test servers, we're using the Pyramid debug toolbar, however, it generates http://
links to static content (like its CSS and JavaScript files), while the rest of the content is served over HTTPS. This causes mixed content warnings, and it breaks all functionality. Is there a way to force it to generate HTTPS links?
I know it's possible to enable mixed content in Chrome, and this works, but it's not a feasible solution for the entire QA team.
There might be better/simpler ways to achieve this, but one thing you can do to achieve this add the
_scheme='https'
parameter to each call torequest.static_url()
.For that you can of course edit
pyramid/url.py
, but you can also do this in your projects'__init__.py
:Parameters for
static_url
works likeroute_url
. From the documentation: