0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

How to use Bootstrap4 Sass in Django 3.0

Posted at

How to use Bootstrap4 Sass in Django 3.0

I set up Django 2.2 and Bootstrap4 Sass from the
'How to use SCSS/SASS in your Django project (Python Way)'.

But can't work Django 3.0.
This is one of resolution.

My testing environment is:
macOS High Sierra Version 10.13.6

prepare PyEnv Virtualenv

$ cd ~
$ pyenv virtualenv 3.7.5 dj3rpi375
$ cd your/django-rpi-tph-monitor/
$ pyenv local dj3rpi375

install Django 3.0 and others

$ pip install --upgrade Django
$ pip install --upgrade pip
$ pip install --upgrade djangorestframework
$ pip install --upgrade markdown
$ pip install --upgrade django-filter
$ pip install --upgrade drf-yasg
$ pip install --upgrade django-bootstrap4
$ pip install -e git://github.com/django-compressor/django-compressor.git@a5bfd775450428e1a261b88e1e5424bfb4dde081#egg=django_compressor
$ pip install --upgrade django-libsass

about django-compressor issue 963.

test

$ ./manage.py test monitor
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
........<BME280: BME280 object (None)>
<BME280: BME280 object (None)>
<BME280: BME280 object (None)>
<BME280: BME280 object (None)>
<BME280: BME280 object (None)>
.<BME280: BME280 object (None)>
.
----------------------------------------------------------------------
Ran 10 tests in 5.034s

OK
Destroying test database for alias 'default'...

But, can't display web page, because 'django_libsass.SassCompiler: command not found'.

resolution hint: from stackoverflow Django Sass Compressor django_libsass.SassCompiler: command not found

install part 2

uninstall django-libsass

$ pip uninstall django-libsass

install sassc

$ brew install sassc

modified settings.py

COMPRESS_PRECOMPILERS = (
    ('text/x-scss', 'pysassc {infile} {outfile}'),
)

Success!

Same as my Gist.

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?