(r'^', include('search.urls')), (r'^', include('activity.urls')), (r'^(?P<region>[^/]+?)/', include('explore.urls')), (r'^', include('explore.global_urls')), # Region userpage -> global userpage redirect (r'^(?P<region>[^/]+?)/((?i)Users)/(?P<username>[^/]+?)/*(?P<rest>(/[^/_]+)|)$', GlobalUserpageRedirectView.as_view()), # Historical URL for dashboard: (r'^(?P<region>[^/]+?)/tools/dashboard/?$', NamedRedirectView.as_view(name='dashboard:main')), (r'^_tools/dashboard/', include(dashboard.site.urls)), (r'^admin$', RedirectView.as_view(url='/admin/')), (r'^admin/subscribers/$', user_passes_test(lambda u: u.is_superuser)( SubscribedList.as_view())), (r'^admin/', include(admin.site.urls)), # Search engine sitemap # (Usually served via apache, but including here as well if using dev server) url(r'^sitemap.xml', include('static_sitemaps.urls')), (r'^(?P<region>[^/]+?)/(((?i)Front[_ ]Page)/?)?', include('frontpage.urls')), ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # This should only happen if you're using the local dev server with # DEBUG=False. if not settings.DEBUG: urlpatterns += patterns( '', (r'^static/(?P<path>.*)$', 'django.views.static.serve', {
urlpatterns = patterns('', (r'^map/', include(maps.site.urls)), (r'^tags$', redirect_to, {'url': '/tags/'}), (r'^tags/', include('sapling.tags.urls', 'tags', 'tags')), (r'^_redirect/', include(redirects.site.urls)), (r'^(?i)Users/', include('sapling.users.urls')), (r'^search/', include('sapling.search.urls')), (r'^', include('sapling.recentchanges.urls')), (r'^tools/', include(dashboard.site.urls)), # JS i18n support. (r'^jsi18n/(?P<packages>\S+?)/$', 'django.views.i18n.javascript_catalog'), (r'^admin$', redirect_to, {'url': '/admin/'}), (r'^admin/subscribers/$', staff_member_required(SubscribedList.as_view())), (r'^admin/', include(admin.site.urls)), ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # This should only happen if you're using the local dev server with # DEBUG=False. if not settings.DEBUG: urlpatterns += patterns('', (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) # Fall back to pages. urlpatterns += patterns('',
(r"^_redirect/", include(redirects.site.urls)), (r"^_links/", include(links.site.urls)), (r"^", include("search.urls")), (r"^", include("activity.urls")), (r"^(?P<region>[^/]+?)/", include("explore.urls")), (r"^", include("explore.global_urls")), # Region userpage -> global userpage redirect ( r"^(?P<region>[^/]+?)/((?i)Users)/(?P<username>[^/]+?)/*(?P<rest>(/[^/_]+)|)$", GlobalUserpageRedirectView.as_view(), ), # Historical URL for dashboard: (r"^(?P<region>[^/]+?)/tools/dashboard/?$", NamedRedirectView.as_view(name="dashboard:main")), (r"^_tools/dashboard/", include(dashboard.site.urls)), (r"^admin$", RedirectView.as_view(url="/admin/")), (r"^admin/subscribers/$", user_passes_test(lambda u: u.is_superuser)(SubscribedList.as_view())), (r"^admin/", include(admin.site.urls)), # Search engine sitemap # (Usually served via apache, but including here as well if using dev server) url(r"^sitemap.xml", include("static_sitemaps.urls")), (r"^(?P<region>[^/]+?)/(((?i)Front[_ ]Page)/?)?", include("frontpage.urls")), ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # This should only happen if you're using the local dev server with # DEBUG=False. if not settings.DEBUG: urlpatterns += patterns( "", (r"^static/(?P<path>.*)$", "django.views.static.serve", {"document_root": settings.STATIC_ROOT}), (r"^media/(?P<path>.*)$", "django.views.static.serve", {"document_root": settings.MEDIA_ROOT}),