Mercurial > hg > savane-forge
annotate urls.py @ 343:c1d7767e3abf
Import news and display site homepage news
author | Sylvain Beucler <beuc@beuc.net> |
---|---|
date | Sat, 28 Aug 2010 23:26:51 +0200 |
parents | eca0a74d8461 |
children | 9c301dc1114e |
rev | line source |
---|---|
154 | 1 # URL dispatching |
255 | 2 # Copyright (C) 2009, 2010 Sylvain Beucler |
154 | 3 # Copyright (C) 2009 Jonathan Gonzalez V. |
4 # | |
5 # This file is part of Savane. | |
6 # | |
7 # Savane is free software: you can redistribute it and/or modify | |
8 # it under the terms of the GNU Affero General Public License as | |
9 # published by the Free Software Foundation, either version 3 of the | |
10 # License, or (at your option) any later version. | |
11 # | |
12 # Savane is distributed in the hope that it will be useful, | |
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 # GNU Affero General Public License for more details. | |
16 # | |
17 # You should have received a copy of the GNU Affero General Public License | |
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | |
20 from django.conf.urls.defaults import * | |
21 from django.conf import settings | |
22 | |
163 | 23 urlpatterns = patterns('',) |
24 | |
200 | 25 # Savane |
163 | 26 urlpatterns += patterns('', |
200 | 27 (r'', include('savane.urls', namespace='savane')), |
154 | 28 ) |
29 | |
200 | 30 # Generic login/logout/change_pass/etc. |
154 | 31 urlpatterns += patterns('', |
32 (r'^accounts/logout/$', 'django.contrib.auth.views.logout', | |
33 {'next_page' : '/'}), # redirect to '/' instead of login page | |
170
3ddd86437b55
Integrate django-registration in the project (TODO: auto-create an ExtendedUser)
Sylvain Beucler <beuc@beuc.net>
parents:
163
diff
changeset
|
34 # django-registration |
3ddd86437b55
Integrate django-registration in the project (TODO: auto-create an ExtendedUser)
Sylvain Beucler <beuc@beuc.net>
parents:
163
diff
changeset
|
35 (r'^accounts/', include('registration.backends.default.urls')), |
154 | 36 (r'^accounts/', include('django.contrib.auth.urls')), |
37 ) | |
38 | |
301
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
39 # Browse the false mailbox, for demo websites: |
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
40 if settings.DEBUG: |
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
41 urlpatterns += patterns('', |
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
42 (r'^dev/webmail/', include('webmail_locmem.urls')), |
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
43 ) |
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
44 |
154 | 45 # Enable the auto-admin: |
46 from django.contrib import admin | |
47 import django | |
48 admin.autodiscover() | |
49 | |
163 | 50 urlpatterns += patterns('', |
51 # Uncomment the admin/doc line below and add 'django.contrib.admindocs' | |
52 # to INSTALLED_APPS to enable admin documentation: | |
301
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
53 (r'^dev/doc/', include('django.contrib.admindocs.urls')), |
163 | 54 |
55 # Uncomment the next line to enable the admin: | |
301
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
56 (r'^dev/', include(admin.site.urls)), |
163 | 57 ) |
301
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
58 # TODO: implement a lighter admin interface for non-dev admins (to |
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
59 # manage project configurations, skills categories, etc.) |
eca0a74d8461
Basic interface to consult demo in-memory e-mail messages
Sylvain Beucler <beuc@beuc.net>
parents:
255
diff
changeset
|
60 # It could reside at '^siteadmin/'. |
154 | 61 |
62 # Static content | |
63 if settings.DEBUG: | |
64 urlpatterns += patterns('django.views.static', | |
65 (r'^' + settings.STATIC_MEDIA_URL[1:] + '(?P<path>.*)$', 'serve', | |
66 {'document_root' : settings.STATIC_MEDIA_ROOT, 'show_indexes' : True}), | |
67 ) |