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" />
The downside to using a dynamic file is that it won’t be as fast as a static file. In all likelihood, that’s not really a problem (the difference is likely negligible). If it later turns out it is a problem, you could just precompute the different CSS and link in the appropriate one.
On an unrelated note, it’s not really safe to trust a cookie to determine if the user is an administrator.