root / commissioning / servers / django_server / server_app / urls.py @ 9f1a1bd0
History | View | Annotate | Download (871 Bytes)
1 |
from django.conf.urls.defaults import * |
---|---|
2 |
from django.conf import settings |
3 |
from views import view |
4 |
|
5 |
# Uncomment the next two lines to enable the admin:
|
6 |
# from django.contrib import admin
|
7 |
# admin.autodiscover()
|
8 |
|
9 |
app_ex = '(?P<appname>[^/]*)'
|
10 |
ver_ex = '(?P<version>[^/]*)'
|
11 |
call_ex = '(?P<callname>[_A-Za-z0-9]*)'
|
12 |
#generic_pattern = (r'^%s/%s/%s' % (app_ex, ver_ex, call_ex), generic_view)
|
13 |
|
14 |
names = settings.COMMISSIONING_APP_NAME |
15 |
names = names.split(',')
|
16 |
|
17 |
pats = [(r'(?P<appname>%s)/%s/%s' % (name, ver_ex, call_ex), view)
|
18 |
for name in names] |
19 |
|
20 |
patterns |
21 |
urlpatterns = patterns('',
|
22 |
# Uncomment the admin/doc line below to enable admin documentation:
|
23 |
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
24 |
|
25 |
# Uncomment the next line to enable the admin:
|
26 |
# (r'^admin/', include(admin.site.urls)),
|
27 |
|
28 |
*pats |
29 |
) |