Skip to content
This repository
branch: staging

Merge pull request #1412 from pculture/gh-1408

Send messages to team as a bulk, for issue 1408
latest commit d265866f86
bendk bendk authored April 17, 2014
Octocat-spinner-32 .docker test updates December 03, 2013
Octocat-spinner-32 .tx fixed transifex config November 26, 2013
Octocat-spinner-32 apps Escaping was done in the model and in the view, with the safe filter,… April 17, 2014
Octocat-spinner-32 bin more work on jenkins support October 16, 2013
Octocat-spinner-32 closure Remove unused compilation scripts. July 27, 2012
Octocat-spinner-32 css-compression Improved sphinx doc, moved deployment guide and running unisubs to th… July 30, 2011
Octocat-spinner-32 deploy updated translation script April 07, 2014
Octocat-spinner-32 docker-dev-environment Merge branch 'gh-1394' into staging April 10, 2014
Octocat-spinner-32 docs display-tweak March 14, 2014
Octocat-spinner-32 jenkins We don't have icanhaz anymore July 23, 2012
Octocat-spinner-32 libs edits per Arther's feedback January 22, 2013
Octocat-spinner-32 locale Manually fixed translatable and translated strings to avoid re-doing … April 08, 2014
Octocat-spinner-32 media Merge pull request #1413 from pculture/gh-1392 April 16, 2014
Octocat-spinner-32 optional Bumping integration repo March 12, 2014
Octocat-spinner-32 puppet merged dev August 13, 2012
Octocat-spinner-32 static try 137 November 29, 2012
Octocat-spinner-32 templates Merge pull request #1405 from pculture/gh-831 April 15, 2014
Octocat-spinner-32 user-data Added static jpeg for testing August 29, 2011
Octocat-spinner-32 utils Merge pull request #1405 from pculture/gh-831 April 15, 2014
Octocat-spinner-32 .agignore Ignore more files. April 09, 2013
Octocat-spinner-32 .agignorevcs Add .agignore and .agignorevcs for better Ag searching. September 20, 2012
Octocat-spinner-32 .ctags Add a .ctags file. January 18, 2012
Octocat-spinner-32 .ffignore Ignore more files. April 09, 2013
Octocat-spinner-32 .gitignore Initial support for a docker development environment September 17, 2013
Octocat-spinner-32 .jshintrc Add jshintrc January 01, 2013
Octocat-spinner-32 .kick Working on new editor HTML and CSS. December 27, 2012
Octocat-spinner-32 COPYING Added license file March 27, 2010
Octocat-spinner-32 Dockerfile Do not apt-get upgrade packages but add precise-updates to repo list,… April 10, 2014
Octocat-spinner-32 README.markdown Update README.markdown January 30, 2013
Octocat-spinner-32 README.transifex Changed all mirosubs references to unisubs. This also entails: August 23, 2011
Octocat-spinner-32 Vagrantfile fixed derp error on vagrantfile March 18, 2013
Octocat-spinner-32 __init__.py Changing our copyright year to 2013. January 03, 2013
Octocat-spinner-32 crossdomain_views.py Added crossdomain views file for last commit. April 18, 2011
Octocat-spinner-32 dev_settings.py Adding timing logging output in dev_settings. August 13, 2013
Octocat-spinner-32 dev_settings_selenium.py add some dashboard tests for task enabled teams. February 13, 2013
Octocat-spinner-32 dev_settings_test.py Test improvements June 28, 2013
Octocat-spinner-32 docker_dev_settings.py Switch to the dummy backend on docker dev December 17, 2013
Octocat-spinner-32 docker_dev_settings_test.py add nose configs to write out nosetests.xml November 19, 2013
Octocat-spinner-32 g.dot Fixed test_two_subtitle_langs_can_exist November 08, 2012
Octocat-spinner-32 initial_data.yaml there were two entries for site 15 so the wrong base url was returned… October 25, 2012
Octocat-spinner-32 manage.py Changing our copyright year to 2013. January 03, 2013
Octocat-spinner-32 middleware.py Strip Google Analytics cookies to prepare for session caching. June 21, 2012
Octocat-spinner-32 routers.py Corrected stupid mistake with rpc.py. Added uslogging app. April 20, 2011
Octocat-spinner-32 schema.xml more work on jenkins support October 16, 2013
Octocat-spinner-32 search_site.py add base of search view July 07, 2010
Octocat-spinner-32 sentry.dev.conf.py Upgrade sentry. May 18, 2012
Octocat-spinner-32 settings.py Refactored saving things March 31, 2014
Octocat-spinner-32 sitemaps.py Fixed generating counts for the video sitemap November 01, 2013
Octocat-spinner-32 test.sh more update to test script February 05, 2014
Octocat-spinner-32 test_settings.py more work on jenkins support October 16, 2013
Octocat-spinner-32 test_staging_settings.py updated test solr settings October 19, 2012
Octocat-spinner-32 testacular.conf.js 2101: Use text() to replace a node's contents when we're exporting th… February 28, 2013
Octocat-spinner-32 unisubs_settings.py Changing our copyright year to 2013. January 03, 2013
Octocat-spinner-32 urls.py removed unused view February 21, 2014
Octocat-spinner-32 vagrant.sh removed reporting from vagrant (was causing error) ; fixes sifter #1378 September 07, 2012
Octocat-spinner-32 views.py Changing our copyright year to 2013. January 03, 2013
Octocat-spinner-32 wsgi.py removed newrelic from wsgi module July 09, 2012
README.markdown

This repository is the code for the Amara project.

The full documentation can be found at http://amara.readthedocs.org/en/latest/index.html

Quick Start

Amara uses Vagrant to make it easy to get started. If you've never used Vagrant before we highly recommend going through its quick start guide to learn how it works.

To run the development version:

  1. Git clone the repository:

    git clone git://github.com/pculture/unisubs.git unisubs
    

    Now the entire project will be in the unisubs directory.

  2. Install VirtualBox and vagrant if you don't have them yet. Then type:

    vagrant up
    

    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.

  3. Switch over to your vagrant vm with:

    vagrant ssh
    

    By default our ~/.bashrc file will automatically move you to the shared folder and activate the virtualenv.

    Now run following command:

    bootstrap-vagrant.sh
    

    It's safe to run bootstrap-vagrant.sh multiple times if something goes wrong (like PyPi goes down).

  4. Add unisubs.example.com to your hosts file, pointing at 127.0.0.1. This is necessary for Twitter and Facebook oauth to work correctly.

  5. In your vagrant vm (the one you switched to in step 3), run the site with:

    dev-runserver.sh
    

    You can access the site at http://unisubs.example.com:8000.

Testing

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 nosetests. For example:

$ 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:

sudo ./deploy/update_solr_schema_vagrant.sh

TODO: Fix this.

Optional

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 tasks:

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"

Werkzeug Debugger

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.

bpython shell

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.

Metrics

If you want to collect metrics when developing locally (just out of curiosity, or if you want to add some of your own and test them) you'll need to set up the amara-metrics Vagrant box:

git clone git://github.com/pculture/amara-metrics.git metrics
cd metrics
vagrant up

Then add the following line to /etc/hosts on your local (host) machine:

10.10.10.44 graphite.example.com

Finally, turn on metric reporting by changing the ENABLE_METRICS setting in settings_local.py to True.

Now load a few pages to generate some stats, then point your browser at http://graphite.example.com to see the Graphite dashboard. The stats should be under unisubs (which is the hostname of the Vagrant VM).

Something went wrong with that request. Please try again.