Static files setup

Installing LESS Preprocessor

  1. Install Node.js for vagrant users

    • Install prerequisites:

      ~$ sudo apt-get install g++ libssl-dev build-essential
      
    • Download latest Node.js source code (eg.):

      ~$ wget http://nodejs.org/dist/v0.10.20/node-v0.10.20.tar.gz
      
    • Extract source code:

      ~$ tar -zxf node-v0.10.20.tar.gz
      
    • To build Node.js, run inside the extracted folder:

      ~$ ./configure
      ~$ make
      ~$ sudo make install
      

    Note

    For other development environments (eg. virtualenv), follow the Node.js installation guide or use your package manager if a package is available.

  2. Install lessc using npm:

    ~$ sudo npm install -g less
    

Settings

COMPRESS_ENABLED

If set to True django serves static files compressed.

COMPRESS_OFFLINE

If set to True static files will be compressed outside request/response loop. If set to False static files will be processed on user requests.