» pip install talisman
Is flask-talisman still the way to go?
How to configure flask-talisman for CDN scripts and cron jobs in python 3.11 standard google app engine - Stack Overflow
python - Flask-Talisman breaks Flask-Bootstrap - Stack Overflow
When to use flask-talisman?
I'm getting close to publishing an app and am curious if people are still using flask-talisman or if there's something better I should be aware of?
It looks like it hasn't been updates since 2019 so maybe it's outdated?
Chime in if you've used it and or have other suggestions.
Thanks flask community!
It's an old thread, but the answer is that you need to whitelist your allowed sites, like in this example (directly from flask-talisman web site):
csp = {
'default-src': [
'\'self\'',
'cdnjs.cloudflare.com'
]
}
talisman = Talisman(app, content_security_policy=csp)
Building on jrborba's answer above, this is what I have used to prevent Tailsman from breaking Bootstrap and jQuery, but you may not need to use the unsafe-inline line as I did.
csp = {
'default-src': [
'\'self\'',
'\'unsafe-inline\'',
'stackpath.bootstrapcdn.com',
'code.jquery.com',
'cdn.jsdelivr.net'
]
}
talisman = Talisman(app, content_security_policy=csp)
So I was getting an app ready for deployment, when I came across flask-talisman. I don't quite understand what its purpose is, but from the look of it, it is probably used to secure your website from accessing content from unwanted origins ( the `content_security_policy` option in Talisman )
If my assumptions are correct, would it make sense to use it, if I am serving my static assets using the same server as my website? I am confused as to the use case of this particular package