Is there a disadvantage to using a dynamic Python file to generate the CSS for a webpage? I'd like computers with an administrator cookie to show special admin panel CSS, and show regular CSS for all other users. I'm planning to use:
<link rel="stylesheet" href="/css.py" type="text/css" />
That should work fine.
I hope, however, that you're not relying on CSS alone to restrict admin functionality.
You can do that. Just realize that there will be a performance hit on each page. CSS files are usually cached as they do not change often.
In theory you do not need to even use an <link> as you can render the style right in the page as a <style>, as it will be refreshed every page request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With