Add a sync_timestamp URL to point automirror at

This commit is contained in:
Magnus Hagander
2011-11-05 18:51:10 +01:00
parent 614bc1b576
commit 7874abc24d
2 changed files with 9 additions and 0 deletions

View File

@ -141,6 +141,13 @@ def system_information(request):
'client_ip': get_client_ip(request),
})
# Sync timestamp for automirror. Keep it around for 30 seconds
# Basically just a check that we can access the backend still...
@cache(seconds=30)
def sync_timestamp(request):
return HttpResponse(datetime.now().strftime("%Y-%m-%d %H:%M:%S\n"),
mimetype='text/plain')
# List of all unapproved objects, for the special admin page
@login_required
@user_passes_test(lambda u: u.is_superuser)

View File

@ -106,6 +106,8 @@ urlpatterns = patterns('',
# Some basic information about the connection (for debugging purposes)
(r'^system_information/$', 'pgweb.core.views.system_information'),
# Sync timestamp, for automirror
(r'^web_sync_timestamp$', 'pgweb.core.views.sync_timestamp'),
# Override some URLs in admin, to provide our own pages
(r'^admin/pending/$', 'pgweb.core.views.admin_pending'),