Skip to content
Snippets Groups Projects
installation.rst 2.36 KiB

Installation

Install Yarn from npm:

npm install -g yarn

And django-yarnpkg package:

pip install django-yarnpkg

Add django-bower to INSTALLED_APPS in your settings:

'django_yarnpkg',

Add staticfinder to STATICFILES_FINDERS:

'django_yarnpkg.finders.NodeModulesFinder',

Specify path to node modules root (you need to use absolute path):

NODE_MODULES_ROOT = '/PROJECT_ROOT/node_modules/'

If you need, you can manually set path to yarn

YARN_PATH = '/usr/bin/yarnpkg'

Example settings file with django-yarnpkg: