NDS Developing
Setting up a development or testing environment goes in three major steps.
- Install virtualenv
- Initialize a virtual environment
- Install requirements.txt in the virtualenv
- Install node/client-side development requirements
Install virtualenv
The easiest way is:
pip install virtualenv
Though you may need to prepend sudo.
For additional help, see virtualenv.
Initialize a virtual environment
Enter the NDS src directory
cd ~/main/apps/dicts/nds/src/
Create a virtualenv
virtualenv env
Now whenever you intend to work in the project, you can run the following:
source env/bin/activate
And this will switch the paths to use the proper Python installation, with all
You should see some feedback in the command line or path that the virtual
Install requirements.txt in the virtualenv
NB: you only need to do this the first time you install the virtualenv, or
Switch to the neahtta directory:
cd ~/main/apps/dicts/nds/src/neahtta/
And with the virtual environment active, run the following:
pip install -r requirements.txt
Note, you do *not* need to run this as a super user, if you do, there are some
Installing node / npm requirements
NDS requires some Node modules to compress CSS and JS. First follow the install
This should install both Node.js and the related package manager, npm. Once
$ npm
If it is there, switch to the neahtta directory, and install:
$ cd ~/main/apps/dicts/nds/src/neahtta/ $ npm install
This will read dependencies from package.json to the directory
Beginning a development session
With the environment prepared, you may start work on NDS. However, if you need
source env/bin/activate
... and then start a development server
fab PROJNAME runserver
NB: for some changes to config files you will need to stop and restart the
Troubleshooting:
Missing SSH config file:
You might see an error like:
(env) $ fab saanih runserver [localhost] Executing task 'saanih' Warning: Unable to load SSH config file '/Users/username/.ssh/config'
If this is the case, check your home directory ~/.ssh/config, and confirm
Missing node dependencies
* Missing dependency in $PATH: uglifyjs Install the executable, check that it is available in $PATH, and check that it's executable.
The error means what it says, however there are some things to check:
- Look at the output of which uglifyjs, if there is nothing:
- Doublecheck that npm install really worked, and there are executables to be found in .../neahtta/node_modules/.bin/, and that there were no errors from that command
- Check your $PATH variable for node_modules/.bin/
- Doublecheck that npm install really worked, and there are executables to be found in .../neahtta/node_modules/.bin/, and that there were no errors from that command