Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
IndexView added
Browse files Browse the repository at this point in the history
  • Loading branch information
b3b committed May 9, 2012
1 parent e2645f3 commit 9a0ebfd
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
13 changes: 13 additions & 0 deletions jadro/templates/jadro/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>API form</title>
</title>
<body>
<ul>
{% for url in urls %}
<li><h2><a href={{url.href}}>{{url.name}}</a></h2></li>
{% endfor %}
</ul>
</body>
</html>
12 changes: 10 additions & 2 deletions jadro/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
from django.contrib import databrowse
from django.db.models import get_models
from jadro_droid import urls as droid_urls
from views import IndexView

admin.autodiscover()

index_urls = (
{'name': 'Databrowse', 'href': '/admin/'},
{'name': 'Admin', 'href': '/admin/'},
{'name': 'API form', 'href': '/droid/form'},
)

databrowse.site.register(*get_models())
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', IndexView.as_view(urls=index_urls)),
url(r'^admin/', include(admin.site.urls), name='xxxx'),
url(r'^droid/', include(droid_urls)),
url(r'^(.*)', databrowse.site.root),
url(r'^databrowse/', databrowse.site.root),
)
8 changes: 8 additions & 0 deletions jadro/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.views.generic import TemplateView, ListView

class IndexView(TemplateView):
template_name = 'jadro/index.html'
urls = []

def get_context_data(self, **kwargs):
return {'urls': self.urls}

0 comments on commit 9a0ebfd

Please sign in to comment.