2010-05-13 06:25:56 +04:00
|
|
|
from django.conf.urls.defaults import include, patterns
|
2010-02-08 22:45:49 +03:00
|
|
|
from django.conf import settings
|
2010-05-19 06:00:23 +04:00
|
|
|
from django.contrib import admin
|
|
|
|
|
2010-05-15 05:10:59 +04:00
|
|
|
import authority
|
2010-05-19 06:00:23 +04:00
|
|
|
|
2010-02-04 02:09:30 +03:00
|
|
|
|
2010-05-15 05:10:59 +04:00
|
|
|
admin.autodiscover()
|
|
|
|
authority.autodiscover()
|
2010-02-04 02:09:30 +03:00
|
|
|
|
|
|
|
urlpatterns = patterns('',
|
2010-04-24 01:08:50 +04:00
|
|
|
(r'^search', include('search.urls')),
|
|
|
|
(r'^forums', include('forums.urls')),
|
2010-05-12 06:01:13 +04:00
|
|
|
(r'^questions', include('questions.urls')),
|
2010-05-19 06:00:23 +04:00
|
|
|
(r'^admin/', include(admin.site.urls)),
|
2010-02-04 02:09:30 +03:00
|
|
|
)
|
2010-02-08 22:45:49 +03:00
|
|
|
|
2010-04-28 07:50:55 +04:00
|
|
|
# Handle 404 and 500 errors
|
|
|
|
handler404 = 'sumo.views.handle404'
|
2010-04-28 21:26:28 +04:00
|
|
|
handler500 = 'sumo.views.handle500'
|
2010-04-28 07:50:55 +04:00
|
|
|
|
2010-02-08 22:45:49 +03:00
|
|
|
if settings.DEBUG:
|
|
|
|
media_url = settings.MEDIA_URL.lstrip('/').rstrip('/')
|
|
|
|
urlpatterns += patterns('',
|
|
|
|
(r'^%s/(?P<path>.*)$' % media_url, 'django.views.static.serve',
|
|
|
|
{'document_root': settings.MEDIA_ROOT}),
|
|
|
|
)
|