This repository is the code for the Amara project.
The full documentation can be found at http://amara.readthedocs.org/en/latest/index.html
To run the development version:
Git clone the repository:
git clone git://github.com/pculture/unisubs.git unisubs
Now the entire project will be in the unisubs directory.
Install VirtualBox and vagrant if you don't have them yet. Then type:
This is going to create a vm and provision it. It should take 10-15 minutes. Remember what mom said: a watched pot never boils.
Switch over to your vagrant vm with:
By default our
~/.bashrcfile will automatically move you to the shared folder and activate the virtualenv.
Now run following command:
It's safe to run
bootstrap-vagrant.shmultiple times if something goes wrong (like PyPi goes down).
unisubs.example.comto your hosts file, pointing at
127.0.0.1. This is necessary for Twitter and Facebook oauth to work correctly.
In your vagrant vm (the one you switched to in step 3), run the site with:
You can access the site at http://unisubs.example.com:8000.
To run unit tests, use the
pmt alias. This will ensure that you're using the
correct settings for testing.
You can specify specific tests to run, just like if you were using
$ vagrant ssh # Just the tests in apps/teams/tests/permissions.py $ pmt apps.teams.tests.permissions # Tests defined as a class in apps/teams/tests/permissions.py $ pmt apps.teams.tests.permissions:TestRules # One specific test $ pmt apps.teams.tests.permissions:TestRules.test_can_add_video # Everything: $ pmt
Note: you may need to rebuild the Solr schema after running tests. To do so, run the following command on the server:
TODO: Fix this.
You can optionally set up a few other pieces of the development environment that we haven't automated yet.
RabbitMQ and Celery
Add the following to
settings_local.py to use RabbitMQ and Celery for async
CELERY_ALWAYS_EAGER = False CELERY_RESULT_BACKEND = "amqp" BROKER_BACKEND = 'amqplib' BROKER_HOST = "localhost" BROKER_PORT = 5672 BROKER_USER = "usrmquser" BROKER_PASSWORD = "usrmqpassword" BROKER_VHOST = "ushost"
If you want to use the awesome Werkzeug debugging runserver instead of the standard Django one, you just have to run (while the virtualenv is activated):
pip install werkzeug
And then use
./dev-runserver.sh plus to run it.
If you want to use the awesome bpython shell instead of the normal one you just need to run (while the virtualenv is activated):
pip install bpython
Now when you run
pm shell it will use bpython automatically.