This repository has been archived by the owner on Oct 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.py
131 lines (92 loc) · 4.8 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
from django.views.generic.simple import redirect_to
from django.views.generic.list_detail import object_list
from django.views.generic.simple import direct_to_template
from poly_assoc_website.views import *
from poly_assoc_website.models import Event
#from sitemap import SitemapForum, SitemapTopic
#from forms import RegistrationFormUtfUsername
#from djangobb_forum import settings as forum_settings
# HACK for add default_params with RegistrationFormUtfUsername and backend to registration urlpattern
# Must be changed after django-authopenid #50 (signup-page-does-not-work-whih-django-registration)
# will be fixed
'''from django_authopenid.urls import urlpatterns as authopenid_urlpatterns
for i, rurl in enumerate(authopenid_urlpatterns):
if rurl.name == 'registration_register':
authopenid_urlpatterns[i].default_args.update({'form_class': RegistrationFormUtfUsername})'''
# 'backend': 'registration.backends.default.DefaultBackend'})
# elif rurl.name == 'registration_activate':
# authopenid_urlpatterns[i].default_args = {'backend': 'registration.backends.default.DefaultBackend'}
admin.autodiscover()
'''
sitemaps = {
'topic': SitemapTopic,
}'''
urlpatterns = patterns('',
# Site base
url(r'^$', redirect_to, {'url' : '/cms/latest-news/'}),
# CMS
url(r'^cms/', include('cms.urls')),
# Admin
url(r'^admin/', include(admin.site.urls)),
(r'^news/add/complete', direct_to_template, {'template':"poly_assoc_website/news_add_complete.html"}),
url(r'^news/', include('cmsplugin_advancednews.urls')),
url(r'^news/(?P<news_id>\d+)/edit/', news_edit, name="news_edit"),
url(r'^news/(?P<news_id>\d+)/delete/', news_delete, name="news_delete"),
url(r'^news/add/', add_news, name="add_news"),
#Haystack
(r'^search/', include('haystack.urls')),
# Sitemap
#(r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
# Forum Apps
#(r'^forum/account/', include(authopenid_urlpatterns)),
#(r'^forum/', include('djangobb_forum.urls', namespace='djangobb')),
# Userena
url(r'^accounts/', include('userena.urls')),
(r'^accounts/logout$', signout),
# Polychaetologists Association Website
(r'^my-items/(?P<user_pk>\d+)/', my_items),
#url(r'^my_item/(P<item_class>\w+)/(?P<item_id>\d+)/', my_item_delete, name="my_item_delete"),
url(r'^news/add/', add_news),
(r'^useful-links/', useful_links),
url(r'^new-link/', new_useful_link, name="add_link"),
url(r'^useful-link/(?P<link_id>\d+)/edit/', link_edit, name="link_edit"),
url(r'^useful-link/(?P<link_id>\d+)/delete/', link_delete, name="link_delete"),
(r'^latest-links/', latest_links),
url(r'^event/add/$', add_event, name="add_event"),
(r'^event/add/complete/', direct_to_template,{'template':"poly_assoc_website/event_add_complete.html"}),
url(r'^event/$', event_detail, name="event_detail"),
url(r'^event/(?P<event_id>\d+)/edit/', event_edit, name="event_edit"),
url(r'^event/(?P<event_id>\d+)/delete/', event_delete, name="event_delete"),
(r'^events/', show_all_events),
(r'^publications/$', publications),
(r'^publications/%(username)s/', my_publications),
url(r'^publication/add/$', add_publication, name="add_publication"),
(r'^publication/add/complete/$', direct_to_template, {'template' : 'poly_assoc_website/publication_add_complete.html'}),
url(r'^publication/(?P<pub_id>\d+)/edit/', publication_edit, name="publication_edit"),
url(r'^publication/(?P<pub_id>\d+)/delete/', publication_delete, name="publication_delete"),
url(r'^publication/(?P<pub_id>\d+)/$', publication_detail, name="publication_detail"),
(r'^photos/$', photo_gallery),
(r'^photos/(\w+)$', photo_gallery),
url(r'^photos/add/$', add_photo, name="add_photo"),
(r'^photos/add/complete/$', direct_to_template, {'template' : "poly_assoc_website/photo_add_complete.html"}),
url(r'^photo/(?P<photo_id>\d+)/edit/$', photo_edit, name="photo_edit"),
url(r'^photo/(?P<photo_id>\d+)/delete/$', photo_delete, name="photo_delete"),
(r'^members/$', members_list),
url(r'^members/(.+)/$', member_profile, name="member_profile"),
(r'^researchers_list/$', direct_to_template, {'template': 'poly_assoc_website/researchers_list.html'})
)
'''if (forum_settings.PM_SUPPORT):
urlpatterns += patterns('',
(r'^forum/pm/', include('messages.urls')),
)'''
if settings.SERVE_STATIC_FILES:
urlpatterns += patterns('',
(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
(r'^' + settings.MEDIA_URL.lstrip('/'), include('appmedia.urls')),
)
# staticfiles
#urlpatterns += staticfiles_urlpatterns()