| 1 | # (c) Roland van Laar
|
---|
| 2 |
|
---|
| 3 | from django.conf.urls.defaults import *
|
---|
| 4 | from exodus.models import *
|
---|
| 5 | from os import path as os_path
|
---|
| 6 | from django.conf import settings
|
---|
| 7 | from django.views.generic.simple import direct_to_template
|
---|
| 8 | from django.contrib import databrowse
|
---|
| 9 | from django.contrib import admin
|
---|
| 10 | admin.autodiscover()
|
---|
| 11 |
|
---|
| 12 | urlpatterns = patterns('',
|
---|
| 13 | # generic view
|
---|
| 14 | url(r'^$', 'exodus.urls.direct_to_template', {'template': 'index.html'}, \
|
---|
| 15 | "root"),
|
---|
| 16 | (r'^view/nodelist/$', 'exodus.views.viewNodelist'),
|
---|
| 17 | (r'^view/list/(?P<model>.+)/$', 'exodus.views.viewList'),
|
---|
| 18 | (r'^view/node/(?P<node>.+)/$', 'exodus.views.viewNode'),
|
---|
| 19 |
|
---|
| 20 | # config urls
|
---|
| 21 | (r'^config/(?P<version>.+)/(?P<node>.+)/(?P<file>.+)$', 'exodus.views.configFile'),
|
---|
| 22 |
|
---|
| 23 | # Generic urls
|
---|
| 24 | (r'^(?P<mode>(add|edit|delete))/node/(?P<node>.+)/$', 'exodus.views.genericNode'),
|
---|
| 25 | (r'^(?P<mode>(add|edit|delete))/nic/(?P<node>.+)/(?P<interface>.+)/$', 'exodus.views.genericInterface'),
|
---|
| 26 | (r'^(?P<mode>(add|edit|delete))/dhcp/(?P<node>.+)/(?P<interface>.+)/(?P<publicAP>.+)/$', 'exodus.views.genericPublicAP'),
|
---|
| 27 | (r'^(?P<mode>(add|edit|delete))/(?P<model>.+)/(?P<object>.+)/$', 'exodus.views.genericModel'),
|
---|
| 28 |
|
---|
| 29 | # 3th party/embedded database browser
|
---|
| 30 | (r'^databrowse/(.*)', databrowse.site.root),
|
---|
| 31 |
|
---|
| 32 | (r'^admin/(.*)', admin.site.root),
|
---|
| 33 | )
|
---|
| 34 |
|
---|
| 35 | if settings.DEBUG:
|
---|
| 36 | urlpatterns += patterns('',
|
---|
| 37 | url(r'^static/(?P<path>.*)$$', 'django.views.static.serve', {'document_root':
|
---|
| 38 | settings.EXODUS_STATIC_ROOT }, "static"),
|
---|
| 39 | )
|
---|