3 from django import VERSION as DJANGO_VERSION
4 from django.http import HttpResponse
5 from django.utils.translation import ugettext as _
6 from django.utils import simplejson
8 from base import get_site_views, get_server_name
9 from settings import SITE_KEY
10 from forum.settings import APP_URL, SVN_REVISION
11 from forum.views.admin import admin_tools_page, admin_page
13 @admin_tools_page(_('updater'), _('Update Checker'))
14 def updater_index(request):
16 'modules/updater/index.html',
22 def updater_check(request):
23 # Get the SVN Revision
25 svn_revision = int(SVN_REVISION.replace('SVN-', ''))
27 # Here we'll have to find another way of getting the SVN revision
30 statistics = """<check>
31 <key value="%(site_key)s" />
32 <app_url value="%(app_url)s" />
33 <svn_revision value="%(svn_revision)d" />
34 <views value="%(site_views)d" />
35 <active_users value="11959" />
36 <server value="%(server_name)s" />
37 <python_version value="%(python_version)s" />
38 <django_version value="%(django_version)s" />
39 <database value="MySQL 5" />
42 'site_key' : SITE_KEY,
44 'svn_revision' : svn_revision,
45 'site_views' : get_site_views(),
46 'server_name' : get_server_name(),
47 'python_version' : ''.join(sys.version.splitlines()),
48 'django_version' : str(DJANGO_VERSION),
50 return HttpResponse(statistics, mimetype='text/plain')
53 json = simplejson.dumps({'name' : 'Jordan'})
54 return HttpResponse(json, mimetype='application/json')