diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-05-13 20:13:17 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-05-13 20:13:17 -0400 |
commit | cb66aae356058e6afa292d8b7951fb5614c680ac (patch) | |
tree | b7156bab8789c672394d63018ec79d394fe88312 /forum | |
parent | 19ed0de43de734682df792c3848e3b1f22c8e9c5 (diff) | |
download | askbot-cb66aae356058e6afa292d8b7951fb5614c680ac.tar.gz askbot-cb66aae356058e6afa292d8b7951fb5614c680ac.tar.bz2 askbot-cb66aae356058e6afa292d8b7951fb5614c680ac.zip |
unified cron job files and added update to russian translation
Diffstat (limited to 'forum')
-rw-r--r-- | forum/auth.py | 2 | ||||
-rw-r--r-- | forum/cron/askbot_cron_job | 18 | ||||
-rwxr-xr-x | forum/cron/multi_award_badges | 5 | ||||
-rwxr-xr-x | forum/cron/multi_award_badges_virtualenv | 10 | ||||
-rwxr-xr-x | forum/cron/once_award_badges | 14 | ||||
-rwxr-xr-x | forum/cron/once_award_badges_virtualenv | 10 | ||||
-rw-r--r-- | forum/cron/send_email_alerts | 5 | ||||
-rw-r--r-- | forum/cron/send_email_alerts_virtualenv | 10 | ||||
-rw-r--r-- | forum/doc/INSTALL | 14 |
9 files changed, 27 insertions, 61 deletions
diff --git a/forum/auth.py b/forum/auth.py index 6c9998cb..fb3a5a68 100644 --- a/forum/auth.py +++ b/forum/auth.py @@ -236,7 +236,7 @@ def onAnswerAccept(answer, user, timestamp=None): ) answer.author.save() reputation = Repute(user=answer.author, - positive=REP_GAIN_FOR_RECEIVING_ANSWER_ACCEPTANCE, + positive=forum_settings.REP_GAIN_FOR_RECEIVING_ANSWER_ACCEPTANCE, question=answer.question, reputed_at=timestamp, reputation_type=2, diff --git a/forum/cron/askbot_cron_job b/forum/cron/askbot_cron_job new file mode 100644 index 00000000..71910f27 --- /dev/null +++ b/forum/cron/askbot_cron_job @@ -0,0 +1,18 @@ +#!/bin/sh +# this is a cron job for askbot that includes all +# commands that need to be run periodically +# please find introduction to cron here: +# http://www.unixgeeks.org/security/newbie/unix/cron-1.html +# +# if you prefer, you can split this file into several + +PROJECT_PARENT_DIR=/path/to/dir_containing_askbot_site +PROJECT_DIR_NAME=askbot_site + +export PYTHONPATH=$PROJECT_PARENT_DIR:$PYTHONPATH +PROJECT_ROOT=$PYTHONPATH/$PROJECT_NAME + +#these are actual commands that are to be run +python $PROJECT_ROOT/manage.py send_email_alerts +python $PROJECT_ROOT/manage.py once_award_badges +python $PROJECT_ROOT/manage.py multi_award_badges diff --git a/forum/cron/multi_award_badges b/forum/cron/multi_award_badges deleted file mode 100755 index 3d768772..00000000 --- a/forum/cron/multi_award_badges +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -PYTHONPATH=/path/to/dir_above_askbot_site -export PYTHONPATH -PROJECT_ROOT=$PYTHONPATH/askbot_site -python manage.py multi_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 diff --git a/forum/cron/multi_award_badges_virtualenv b/forum/cron/multi_award_badges_virtualenv deleted file mode 100755 index 4230fb22..00000000 --- a/forum/cron/multi_award_badges_virtualenv +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -WORKON_HOME=~/envs/askbot -PROJECT_ROOT=~/webapps/askbot_server/projects/askbot/ - -# activate virtual environment -. $WORKON_HOME/bin/activate - -cd $PROJECT_ROOT -python manage.py multi_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 diff --git a/forum/cron/once_award_badges b/forum/cron/once_award_badges deleted file mode 100755 index 069656ca..00000000 --- a/forum/cron/once_award_badges +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -PYTHONPATH=/path/to/dir_above_askbot_site -export PYTHONPATH -PROJECT_ROOT=$PYTHONPATH/askbot_site -python manage.py once_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 - - -#!/bin/sh -PYTHONPATH=/usr/local/sites/askbot_production -export PYTHONPATH -PROJECT_ROOT=$PYTHONPATH/robofaqs -python $PROJECT_ROOT/manage.py once_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 -python $PROJECT_ROOT/manage.py multi_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 -python $PROJECT_ROOT/manage.py send_email_alerts >> $PROJECT_ROOT/log/cron_email.log 2>&1
\ No newline at end of file diff --git a/forum/cron/once_award_badges_virtualenv b/forum/cron/once_award_badges_virtualenv deleted file mode 100755 index 0011981c..00000000 --- a/forum/cron/once_award_badges_virtualenv +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -WORKON_HOME=~/envs/askbot -PROJECT_ROOT=~/webapps/askbot_server/projects/askbot/ - -# activate virtual environment -. $WORKON_HOME/bin/activate - -cd $PROJECT_ROOT -python manage.py once_award_badges >> $PROJECT_ROOT/log/cron_badges.log 2>&1 diff --git a/forum/cron/send_email_alerts b/forum/cron/send_email_alerts deleted file mode 100644 index 7581a88c..00000000 --- a/forum/cron/send_email_alerts +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -PYTHONPATH=/path/to/dir_above_askbot_site -export PYTHONPATH -PROJECT_ROOT=$PYTHONPATH/askbot_site -/path/to/python $PROJECT_ROOT/manage.py send_email_alerts diff --git a/forum/cron/send_email_alerts_virtualenv b/forum/cron/send_email_alerts_virtualenv deleted file mode 100644 index 2f1b64d0..00000000 --- a/forum/cron/send_email_alerts_virtualenv +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -WORKON_HOME=~/envs/askbot -PROJECT_ROOT=~/webapps/askbot_server/projects/askbot/ - -# activate virtual environment -. $WORKON_HOME/bin/activate - -cd $PROJECT_ROOT -python manage.py send_email_alerts >> $PROJECT_ROOT/log/cron_mail.log 2>&1 diff --git a/forum/doc/INSTALL b/forum/doc/INSTALL index 73714566..f1d1e498 100644 --- a/forum/doc/INSTALL +++ b/forum/doc/INSTALL @@ -254,14 +254,16 @@ WSGIPythonEggs /var/python/eggs #must be readable and writable by apache and uncomment #'djangosphinx', -6. Email subscriptions +6. Email subsctiptions and badge awards - This function at the moment requires Django 1.1 + copy file forum/cron/askbot_cron_job + somewhere in your user space (outside of forum) + edit paths in that file - edit paths in the file forum/cron/send_email_alerts - set up a cron job to call forum/cron/send_email_alerts once or twice a day - subscription sender may be tested manually in shell - by calling forum/cron/send_email_alerts + set up a cron job to call it say hourly + + the commands within askbot_cron_job can also be called manually + from the command line for the testing purposes 7. Sitemap Sitemap will be available at /<settings_local.FORUM_SCRIPT_ALIAS>sitemap.xml |