Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Scrum vu des petites tranchées
Python Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

UXperiment Build Status

Code related to the «Scrum vu des petites tranchées» talk to be given at Paris-Web 2012.


Clone the project:

$ git clone
$ cd prswb

Create a new virtualenv in ./.env and enable it:

$ virtualenv --no-site-packages `pwd`/.env
$ source .env/bin/activate

Install dependencies:

$ pip install -r requirements-dev.txt

To launch a local dev webserver instance:

$ export UXPERIMENT_ENV=dev
$ python runserver
Validating models...

0 errors found
Django version 1.4.1, using settings 'uxperiment.settings'
Development server is running at
Quit the server with CONTROL-C.

Head to, profit.

Updating the codebase

After each git pull, you have to run the following commands:

$ pip install -r requirements-dev.txt
$ python syncdb
$ python migrate
$ python collectstatic

Working with Sass & Compass

Stylesheets are handled through Compass.

To get started:

$ sudo gem install compass
$ cd generic/static
$ compass watch
>>> Compass is polling for changes. Press Ctrl-C to Stop.

Now you can edit the stylesheets in the sass/ directory, related css files will be compiled in the background.

Settings management

This django project has a settings/ directory having a setting module per environment:

    |-        # common shared settings
    |-         # dev settings
    |-  # production settings (hosting platform yet to be determined)
    |-     # staging (hosted on heroku)
    |-        # travis settings

Eventually, custom settings may be stored in a settings/ module.

The UXPERIMENT_ENV environment variable will set the specific settings module to load. To run the local webserver against a given environment:

$ UXPERIMENT_ENV=test python runserver

If you intend to work always with a given environment within the project virtualenv:

$ echo 'export UXPERIMENT_ENV=dev' >> .env/bin/postactivate
$ echo 'export unset UXPERIMENT_ENV' >> .env/bin/postdeactivate

Deploying on Heroku

The staging is hosted on Heroku and reachable at

Note: You'll have to download and install the Heroku Toolbelt in order to manage some of the remote deployment procedures detailed below.

Deploying with a push

Your git user must have push privileges on the heroku repository. You must also provide your SSH public key to the admin account of the uxperiment project.

Once done, add this section to the .git/config of your local clone of the repo:

[remote "heroku"]
    url =
    fetch = +refs/heads/*:refs/remotes/heroku/*

To push and deploy to heroku:

$ git push heroku master

Post push deployment

After a push, Heroku will load the packages defined in the requirements.txt file. At the end of the process, the Procfile will be used by Heroku to start the server.

Basically the Procfile will run these commands:

$ python migrate
$ python collectstatic --noinput
$ python run_gunicorn -b$PORT

Environment & settings

To tell Heroku to use the staging environment:

$ heroku config:set UXPERIMENT_ENV=staging

The staging settings module uses environment variables to configure the platform; to set them you have to use the heroku config:add command:

$ heroku config:add VARIABLE=VALUE

Here are some of the settings required for the staging to work properly:

  • EMAIL_RECIPIENT: The email address to receive notification emails sent from the platform
  • EMAIL_HOST_USER: The email user account name to send the email from
  • EMAIL_HOST_PASSWORD: The email user account password

Heroku commands

You can always run django commands using the heroku run command, eg:

$ heroku run 'python migrate'

To tail the server logs:

$ heroku logs --tail

Travis-CI Test Environment

The .travis.yml file at the root of the repository contains the required configuration.

Code review

Somebody submitted a new pull-request, let's say:

This is a pull-request from n1k0 on his i18n-pages branch. To retrieve the branch in order to test it:

$ git remote add n1k0
$ git fetch n1k0 i18n-pages
 * branch            i18n-pages -> FETCH_HEAD
$ git checkout -b pr-24
Switched to a new branch 'pr-24'
$ git pull --rebase n1k0 i18n-pages
 * branch            i18n-pages -> FETCH_HEAD

Now you can launch tests, verify scenario and so on. To get back on master:

$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 47 commits.

To sync from central repository:

$ git remote add upstream git://
$ git pull upstream master
From git://
 * branch            master     -> FETCH_HEAD
Something went wrong with that request. Please try again.