Ember

Salt

If your Django site has an Ember front end, then add ember: True to your sites file:

# sites/my.sls
sites:
  www.hatherleigh.info:
    package: hatherleigh_info
    profile: django
    ember: True

The default path for your Django app will be /back/ and the default path for your Ember app will be /. If you want to override this, then you can set the ember_path and django_path as follows:

# sites/my.sls
sites:
  www.hatherleigh.info:
    package: hatherleigh_info
    profile: django
    ember: True
    ember_path: front
    django_path: back

Note

The Salt state files will take care of the /.

Installation

Prerequisites

Ember-cli is installed using npm. It’s quite tempermental about which version of node to use - you can use nvm to get the latest version (see digital ocean tutorial)

sudo apt update
sudo apt-get install build-essential libssl-dev
# check https://github.com/creationix/nvm for the latest version and replace
# v0.33.1 in the line below with the latest version
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash

# either log out or run the following
source ~/.profile
# Install the latest version
nvm install
# check which version you have installed
nvm ls

Ember will use a global version of bower if it is installed:

npm install -g bower

Install watchman (better then nodewatcher):

npm install -g watchman

Install PhantomJS (for testing):

npm install -g phantomjs-prebuilt

Installing Ember-cli

npm install -g ember-cli

Creating a project

Run the following commands to create a project e.g. ember-first:

ember new ember-first
cd ember-first
ember server

Cloning an existing project

To clone an existing project e.g. ember-first:

git clone git@gitlab.com:proj-owner/ember-first.git
cd ember-first
npm install
bower install
ember server

Testing

Note

We don’t need to define Mirage models, Auto-discovery of Ember Data models