Gustavo Picon is sharing code with you
Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.
Don't show this againdjango-treebeard / tbexample / urls.py
- commit
- 0f2a87d336ee
- parent
- f45c785ede80
- parent
- b38bf3705bca
- branch
- 1.6.X
merging from 1.61 tag to 1.6.X branch
1 |
11d2c27832ed
|
import os |
2 |
11d2c27832ed
|
from django.contrib import admin |
3 |
dc6379f01920
|
from django.conf.urls.defaults import * |
4 |
11d2c27832ed
|
import treebeard |
5 |
dc6379f01920
|
from tbexample.views import convo, load_random_data, delete_node, delete_all |
6 |
07a8db24f7e4
|
from tbexample.views import choose |
7 |
dc6379f01920
|
|
8 |
11d2c27832ed
|
admin.autodiscover() |
9 |
11d2c27832ed
|
|
10 |
dc6379f01920
|
baseurl = r'^(?P<treetype>mp|al|ns)/' |
11 |
dc6379f01920
|
lurls = [ |
12 |
dc6379f01920
|
(r'loaddata/$', load_random_data, 'load-data'), |
13 |
dc6379f01920
|
(r'delete_all/$', delete_all, 'delete-all'), |
14 |
dc6379f01920
|
(r'(?P<node_id>\d+)/delete/$', delete_node, 'delete-node'), |
15 |
dc6379f01920
|
(r'(?P<node_id>\d+)/reply/$', convo, 'reply-view'), |
16 |
dc6379f01920
|
(r'(?P<node_id>\d+)/$', convo, 'node-view'), |
17 |
11d2c27832ed
|
(r'$', convo, 'main-view') |
18 |
dc6379f01920
|
] |
19 |
dc6379f01920
|
|
20 |
11d2c27832ed
|
path = os.path.dirname(treebeard.__file__) |
21 |
11d2c27832ed
|
static_path = os.path.normpath(os.path.join(path, 'static/')) |
22 |
dc6379f01920
|
|
23 |
11d2c27832ed
|
urlpatterns = patterns('', |
24 |
11d2c27832ed
|
(r'^admin/', include(admin.site.urls)), |
25 |
11d2c27832ed
|
(r'^static/(?P<path>.*)$', 'django.views.static.serve', |
26 |
11d2c27832ed
|
{'document_root': static_path, 'show_indexes': True})) |
27 |
11d2c27832ed
|
|
28 |
dc6379f01920
|
for pat, view, name in lurls: |
29 |
dc6379f01920
|
urlpatterns += patterns('', url('%s%s' % (baseurl, pat), view, name=name)) |
30 |
11d2c27832ed
|
urlpatterns += patterns('', url('^$', choose, name='choose-tree')) |