Using SASS with Django

A few months ago I worked on a Rails application and got acquainted with SASS. I found that I really prefer using SASS over CSS to the extent that it’s worth the overhead of learning another tool’s quirks. Here, I’ll describe what worked for me using SASS with Django.

First, if you haven’t installed Rails, walk through this tutorial.

Next, in your Django project, create a “gemset”, which is something like a virtualenv in Python. Run this command and supply your own project name,

$ rvm gemset create <project>
$ rvm gemset use <project>
$ gem install sass

Then, test the install by checking the version of SASS.

$ sass -v

Now, you can set up an .rvmc file so that whenever you navigate to your project, Ruby will know which version and gemset you are using. (Remember to supply your own project name.)

rvm 2.4.0@<project>