Monday, July 29, 2013

Setup email notification for team on github commits

Once more than one person start working on some code its good to get notification on what other team mates are committing and with git repo its easy to setup this with help of google groups.

  1. Create a new google group. Add one member - noreply@github.com
    Add the team/users email address which should be same as their github email id, the one they using it to access repo.
  2. Go to Github repository.
  3. Click on Settings from right navigation.
  4. Click on Service Hooks from left navigation.
  5. Click on Email - Provide google group name you have created (@googlegroups.com).
  6. Click Update the settings.
  7. Check its working fine by click on 'Test Hook'.

At the end you should get sample test email with last commit. After this setup all team members/members of google groups will get email upon commit from anyone on the repo.

Thursday, July 25, 2013

Django inline extend from different pages based on condition

Its been sometime I have posted anything on this blog. Recently I came across nice inline syntax if you need to extend the pages based on certain condition. e.g. I have container master page which i want to choose differently if user is logged in or not -

{% extends user.is_authenticated|yesno:"my_home.html,base_home.html" %}

It checks if person is authenticated or not, if authenticated it will extend my_home.html otherwise it will extend base_home.html