Hacking with Moksha

Setting up your RPM/virtualenv development environments

RPM mod_wsgi installation (Red Hat, Fedora, etc.):
 Setting up a Moksha RPM & mod_wsgi environment (Fedora, RHEL, CentOS)
virtualenv installation (OSX, Ubuntu, etc.):
 Virtualenv installation (Other Linux distros, OSX, Windows, etc)

Getting the code

$ git clone git://git.fedorahosted.org/git/moksha
$ cd moksha/

Bootstrapping Your Environment

$ ./moksha-ctl.py bootstrap

Rebuilding and reinstalling Moksha

$ ./moksha-ctl.py rebuild

Rebuilding and reinstalling all Moksha apps

$ workon moksha
(moksha) $ pip install --upgrade mdemos.all
(moksha) $ deactivate

Rebuilding and reinstalling a specific Moksha apps

$ workon moksha
(moksha) $ pip install --upgrade mdemos.metrics
(moksha) $ deactivate

Restart paster

$ ./moksha-ctl.py restart:paster

Restart the Moksha Hub

$ ./moksha-ctl.py restart:moksha-hub

Debugging your setup

$ ./moksha-ctl.py wtf

Watching the logs

$ ./moksha-ctl.py logs

Generating documentation

$ paver html

Running the test suite

$ workon moksha
(moksha) $ python setup.py test
(moksha) $ deactivate

Rebuilding and reinstall everything, restart everything, and run the test suite

$ ./moksha-ctl.py rebuild restart
$ workon moksha
(moksha) $ python setup.py test
(moksha) $ deactivate

Note

As a developer, performing the full rebuild, reinstall, restart, and test sequence is usually a good habit to get into, however it can take a long time. If you’re hardcore, this RPM patch will speed things up quite a bit.

Freezing requirements

$ pip freeze -E ~/.virtualenvs/moksha -r requirements.txt production/stable-reqs.txt

Profiling the WSGI stack

Open the moksha/config/app_cfg.py file and set the base_config.profile variable to True. After surfing around your application, you can then go to http://localhost:8080/__profile__ to view your profiling statistics.