forked from visiblegovernment/django-fixmystreet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
urls.py
executable file
·96 lines (74 loc) · 2.64 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
from django.conf.urls.defaults import *
from django.conf import settings
from django.http import HttpResponseRedirect
from django.contrib import admin
from mainapp.feeds import LatestReports, LatestReportsByCity, LatestReportsByWard, LatestUpdatesByReport
feeds = {
'reports': LatestReports,
'wards': LatestReportsByWard,
'cities': LatestReportsByCity,
'report_updates': LatestUpdatesByReport,
}
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
(r'^i18n/', include('django.conf.urls.i18n')),
)
urlpatterns += patterns('mainapp.views.main',
(r'^$', 'index'),
(r'^search', 'search_address'),
(r'about/$', 'about')
)
urlpatterns += patterns('mainapp.views.faq',
(r'^about/(\S+)$', 'show'),
)
urlpatterns += patterns('mainapp.views.promotion',
(r'^promotions/(\w+)$', 'show'),
)
urlpatterns += patterns('mainapp.views.wards',
(r'^wards/(\d+)', 'show'),
(r'^cities/(\d+)/wards/(\d+)', 'show_by_number'),
)
urlpatterns += patterns('mainapp.views.cities',
(r'^cities/(\d+)$', 'show'),
(r'^cities', 'index'),
)
urlpatterns += patterns( 'mainapp.views.reports.updates',
(r'^reports/updates/confirm/(\S+)', 'confirm'),
(r'^reports/updates/create/', 'create'),
(r'^reports/(\d+)/updates/', 'new'),
)
urlpatterns += patterns( 'mainapp.views.reports.subscribers',
(r'^reports/subscribers/confirm/(\S+)', 'confirm'),
(r'^reports/subscribers/unsubscribe/(\S+)', 'unsubscribe'),
(r'^reports/subscribers/create/', 'create'),
(r'^reports/(\d+)/subscribers', 'new'),
)
urlpatterns += patterns( 'mainapp.views.reports.flags',
(r'^reports/(\d+)/flags/thanks', 'thanks'),
(r'^reports/(\d+)/flags', 'new'),
)
urlpatterns += patterns('mainapp.views.reports.main',
(r'^reports/(\d+)$', 'show'),
(r'^reports/', 'new'),
)
urlpatterns += patterns('mainapp.views.contact',
(r'^contact/thanks', 'thanks'),
(r'^contact', 'new'),
)
urlpatterns += patterns('mainapp.views.ajax',
(r'^ajax/categories/(\d+)', 'category_desc'),
)
# REST Urls
rest_format = r'(?P<format>\w+)'
urlpatterns += patterns('mainapp.views.rest',
url(r'^rest/reports.%s$'%rest_format, 'reports_rest'),
)
#The following is used to serve up local media files like images
if settings.LOCAL_DEV:
baseurlregex = r'^media/(?P<path>.*)$'
urlpatterns += patterns('',
(baseurlregex, 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
)