Add plug-n-play functionality to your Django project using Django-addons

What is Django-addons?

A Django app used to add true plug-n-play functionality to your own Django applications and projects. Django-addons is brought to you by Indifex, the company behind Transifex.

Django-addons is a bunch of code that makes writing addon/plugins for your Django project much easier. Add django-addons to your Django project and you can drop all the addons to ‘/addons’ directory.

How to install Django-addons?

You can install the latest version of django-addons running
pip install django-addons
or
easy_install django-addons

You can also install the development version of django-addons with
pip install django-addons==dev
or
easy_install django-addons==dev.

Source code

http://code.indifex.com/django-addons/

Features

  • Addons overview page
  • Automatic signal connecting of addons
  • Automatic URL discovery of addons
  • Template hooking system (inject code from addons to your main project)
  • Django-staticfiles to serve site media from each addon
  • Django-notifications support (automatic registration of noticetypes)
  • Per addon localization
  • Per addon settings
  • Disabling addons via ./manage.py addons

Transifex implements related tag cloud

Lately, I have been working on a bunch of exciting new stuffs for Transifex. I have worked on a tag-cloud implementation which not only shows the popular tags, but also shows tags related to a tag selected by the user. It is pretty useful. It directs the user to select more relevant tags. The tag cloud is refreshed each time the user makes a selection to show the related tags.

I built this on top of the django-tagging module. I wrote a model to represent a tag as a node in a graph. The model includes all the tags related to it (that is tags which appear with the tag in concern) as adjacent nodes along with the weight (that is number of times the two tags appear together) of each edge between two related tag nodes. This data is updated and synced as necessary, e.g, after a project is added or updated. Now, whenever a tag is selected, the tag-cloud is refreshed to show the related tags. The font-size of a related tag is decided by taking into consideration both the weight of an edge it shares with the selected tag and its count. Below is a sample use case for related tag-cloud in Transifex.

Let’s say there are two projects, p1 with tag ‘foo1′ and p2 with tags ‘gui’, ‘graphics’, ‘imaging’ and ‘photography’. For sake of simplicity, I am showing only 3 most popular tags: ‘foo1′, ‘gui’, ‘graphics’. So, now when the maintainer for prohect p1 goes to edit the project, he sees the following tag-cloud:

Initial tagcloud

Now, he selects a new tag ‘graphics’ and the tagcloud is refreshed to show the tags related to ‘graphics’.

Tagcloud with related tags.

Such small things together can really take the user experience to a new level. By implementing related tag-clouds, we enable the user to choose relevant tags in a better way. At Transifex, we innovate to help people localize in a better way :) .

Contributing to transifex

For some time, I have been hanging around with django. I got some cool video tutorials on the web on django. They helped me a lot to start coding in django. At the same time, I was also going through the Transifex source code. After some time, I browsed through the tickets in trac.transifex.org and started with fixing ticket #679.

I had to go through javascript, jquery, html in addition to write the patch for #679. I also wrote a custom pagination plugin for dataTables pagination for fixing the issue mentioned in ticket #679. I submitted the patch upstream for review. I hope it will be accepted.

After that Diego directed me to work on ticket #129. Here I had add the provision for a “Remember me” option, which, if selected during login, will set the login duration to 21 days, else, the login session will expire on browser close. I had to create a form class _AuthenticationForm subclassing django’s AuthenticationForm to add a new Boolean form field “Remember me”. Then I had to just pass this _AuthenticationForm as the form argument in simpleauth.views.login and call simpleauth.views.login when the url is of the pattern r’^accounts/login/$’. Yeah … I know this looks odd.

But the best thing about this is that, it works both for simpleauth and for django-profiles. Also, when django-profile is being used, the django-profile templates are used. I have tested this patch on my system, its working fine. I hope the upstream will accept this.