How to award badges?
Clone this wiki locally
To have a balanced performance on awarding system, we decided to run scripts outside. That means system itself won’t trigger badges awarding until you have other process like cron job to do it automatically. As far as I know stackoverflow uses similar way to solve this by running SQL scripts in SQL Agent service.
All scripts are quite easy, and they are executed as django-admin commands located under /forum/management/commands.
To run the command manually or in a cron task, simply you can call it like this:
python manage.py once_award_badges
once_award_badges is one of these commands to check one time only badges in system and award them to users. There is another called multi_award_badges to check other types of badges respectively.
You may have to set
PYTHONPATH environment variable to one level above the cnprog Django application directory for these commands to work.