[Answer]-How does one store CSS in a Django class?

1đź‘Ť

A “style” usually requires more than just a css file – multiple css files, background images, eventually fonts etc.

If “styles” are to be uploable then a possible solution might be to use a FileField accepting a zip, required to contain at least “style.css” file as entry point. Then on upload the file would be unzipped in /styles/ and the SlideStyle model would grow a “style_url” property returning the appropriate url…

My 2 cents.

Leave a comment