mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-06 09:57:57 +00:00
Add a sync_timestamp URL to point automirror at
This commit is contained in:
@ -141,6 +141,13 @@ def system_information(request):
|
|||||||
'client_ip': get_client_ip(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
|
# List of all unapproved objects, for the special admin page
|
||||||
@login_required
|
@login_required
|
||||||
@user_passes_test(lambda u: u.is_superuser)
|
@user_passes_test(lambda u: u.is_superuser)
|
||||||
|
@ -106,6 +106,8 @@ urlpatterns = patterns('',
|
|||||||
|
|
||||||
# Some basic information about the connection (for debugging purposes)
|
# Some basic information about the connection (for debugging purposes)
|
||||||
(r'^system_information/$', 'pgweb.core.views.system_information'),
|
(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
|
# Override some URLs in admin, to provide our own pages
|
||||||
(r'^admin/pending/$', 'pgweb.core.views.admin_pending'),
|
(r'^admin/pending/$', 'pgweb.core.views.admin_pending'),
|
||||||
|
Reference in New Issue
Block a user