da
-> django-admin.py
s
-> da shell_plus
sup
-> da supervisor
Download and install Vagrant. Review the basics of Vagrant if you haven't used it recently.
Clone this repo and change to its directory:
$ git clone git@github.com:fanscribed/fanscribed $ cd fanscribed
Bring up the VM for the first time:
$ vagrant up
If you run into problems during provisioning:
$ vagrant ssh $ sudo salt-call --local state.highstate
If some states fail, run
state.highstate
again.Connect to the VM via SSH:
$ vagrant ssh
Activate the
app
virtualenv:$ workon app
Synchronize the database:
$ da syncdb --migrate --noinput $ da loaddata task_types $ da waffle_update waffle.yaml
Create some demo data:
$ da fix demo
Bring up the VM (if it's not up already):
$ vagrant up
Connect to the VM via SSH:
$ vagrant ssh
Activate the
app
virtualenv and start services:$ workon app $ sup
If you have Zeroconf/Bonjour networking active, visit http://fanscribed-dev.local:7777/.
All Mac OSX systems support this. Many Ubuntu desktop systems do via Avahi.
You can use the Vagrant VM as a data store, running PostgreSQL and Redis, and run your development environment on your OS X host.
Set up a virtualenv using mkvirtualenv. (That is outside the scope of this README)
Activate the virtualenv; let's say you called it
fs
:$ workon fs
Install the development packages:
$ pip install -r requirements/local.txt
Update
postactivate
script:$ cdvirtualenv bin $ vim postactivate
...add this content to it:
export DJANGO_SETTINGS_MODULE=fanscribed.settings.local export DATABASE_URL=postgres://fanscribed:fanscribed@fanscribed-dev.local:5432/fanscribed export BROKER_URL=redis://fanscribed-dev.local:6379/0 export REDIS_CACHE_LOCATION=redis://fanscribed-dev.local:6379/1 export TEST_REDIS_CACHE_LOCATION=redis://fanscribed-dev.local:6379/2 alias da='django-admin.py' alias s='da shell_plus' alias sup='da supervisor'
...then go back to your
fanscribed
dir:$ cd -
Now you can run any of the standard commands as you would inside the VM:
$ da fix demo $ sup
When a requirements file changes, use Vagrant to reprovision:
$ vagrant provision
After a schema migration, resync the db:
$ vagrant ssh # ... after connecting ... $ workon app $ da syncdb --migrate --noinput
With a virtualenv activated:
$ python runtests.py
Arguments are passed along to django-admin.py test
:
$ python runtests.py --failfast
You can skip slower tests using the FAST_TEST
environment var:
$ FAST_TEST=1 python runtests.py