InstallationΒΆ

  • Install with pip:
pip install django-critical-css
  • Your INSTALLED_APPS setting:
INSTALLED_APPS = (
    # ...

    'django_rq',
    'inline_static',

    'critical',
)
  • Settings:

You can run an instance of penthouse service and add its url to settings.

PENTHOUSE_URL = 'http://penthouse:3000/'

Alternatively, you can define your custom function, which takes url and css path as arguments and returns critical css as string.

CRITICAL_CSS_BACKEND = 'function.calculating.critical.css'