diff --git a/binder/bcommon/views.py b/binder/bcommon/views.py new file mode 100644 index 0000000..45fb71b --- /dev/null +++ b/binder/bcommon/views.py @@ -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 }) diff --git a/binder/settings.py b/binder/settings.py index 5f409af..3b64136 100644 --- a/binder/settings.py +++ b/binder/settings.py @@ -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 = ( diff --git a/binder/templates/base.htm b/binder/templates/base.htm new file mode 100644 index 0000000..bb25416 --- /dev/null +++ b/binder/templates/base.htm @@ -0,0 +1,19 @@ + +{% block header %} + + Binder DNS Admin Tool + + +{% endblock header %} + + +{% block body %} + +{% endblock body %} + + +{% block footer %} + +{% endblock footer %} + + diff --git a/binder/templates/bcommon/list_servers.htm b/binder/templates/bcommon/list_servers.htm new file mode 100644 index 0000000..1423793 --- /dev/null +++ b/binder/templates/bcommon/list_servers.htm @@ -0,0 +1,12 @@ +{% extends "base.htm" %} + +{% block body %} +list servers body + + + +{% endblock body %} diff --git a/binder/urls.py b/binder/urls.py index 39122ee..2f80f14 100644 --- a/binder/urls.py +++ b/binder/urls.py @@ -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[a-zA-Z0-9.]+)$', 'bcommon.views.list_server_zones'), + )