Extensions don't matter. You can end it in .jpg
if you want. What does (somehow) matter are the headers. You should send the following header:
Content-Type: text/css; charset=UTF-8
Still, if you don't add that, you won't run into any (immediate) problems. As long as you use type="text/css"
in HTML the browser will know what you're talking about.
Note that, as Glennular said, CSS files are cached. Thus, you might want to use something like:
<link rel="stylesheet" href="/css.py?SOME_RANDOM_SEED" type="text/css" />
Where SOME_RANDOM_SEED
is, obviously, a random character sequence. You can use time.time()
or uuid.uuid4()
or something similar.