/info now works listing the dns servers configured, each linked as well

This commit is contained in:
Jeffrey Forman 2011-04-13 20:49:20 -04:00
parent c10569504b
commit 03ce6bb7db
5 changed files with 46 additions and 7 deletions

10
binder/bcommon/views.py Normal file
View File

@ -0,0 +1,10 @@
# bcommon views
from bcommon.models import BindServer
from django.template import Context
from django.shortcuts import render_to_response
def list_servers(request):
server_list = BindServer.objects.all().order_by('hostname')
return render_to_response('bcommon/list_servers.htm',
{ 'server_list' : server_list })

View File

@ -83,6 +83,7 @@ TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(SITE_ROOT, 'templates')
)
INSTALLED_APPS = (

19
binder/templates/base.htm Normal file
View File

@ -0,0 +1,19 @@
<html>
{% block header %}
<head>
<title>Binder DNS Admin Tool</title>
</head>
{% endblock header %}
<body>
{% block body %}
{% endblock body %}
</body>
{% block footer %}
{% endblock footer %}
</html>

View File

@ -0,0 +1,12 @@
{% extends "base.htm" %}
{% block body %}
list servers body
<ul>
{% for current_server in server_list %}
<li> <a href="/info/{{ current_server }}/"> {{ current_server }} </li>
{% endfor %}
</ul>
{% endblock body %}

View File

@ -5,12 +5,9 @@ from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^binder/', include('binder.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
(r'^info/$', 'bcommon.views.list_servers'),
# (r'^info/(?P<dns_hostname>[a-zA-Z0-9.]+)$', 'bcommon.views.list_server_zones'),
)