Developing kardboard¶
Using Vagrant¶
The way to develop on kardboard is via Vagrant , powered by the included Puppet files.
Default setup¶
# Get the source, using your own fork most likely
git clone git@github.com:cmheisel/kardboard.git
cd kardboard
vagrant up
# ...wait...
vagrant ssh
touch kardboardve/src/kardboard/kardboard-local.cfg
source kardboardve/bin/activate
cd kardboardve/src/kardboard
py.test kardboard
You now have a fully functional kardboard application running under production like environment.
- The application is served by gunicorn and nginx and is available at http://localhost:8080/ from your host machine. It runs at http://localhost:80/ on the guest.
- Memcache is running and used by the application
- Redis is running and used as the queue for your running celery process
- Both the application and celery processes are adminsitered through supervisord
- You can restart both the application and the celery processes, say to pick up your changes, by doing the following:
vagrant ssh
sudo supervisorctl restart all
Development server¶
Testing against a production like environment is all well and good for you, like vegetables. But during development you’ll likely want something tastier, like cookies, or a auto-reloading web server.
vagrant ssh
export KARDBOARD_SETTINGS=/vagrant/kardboard-local.cfg
cd /home/vagrant/kardboardve/
source bin/activate
python src/kardboard/kardboard/runserver.py
The application is now available at http://localhost:5000/ from your host machine.