コード例 #1
0
    (r'^_api/', include('main.api.internal_urls')),
    
    # Comments
    (r'^_comment/', include(crap_comments.site.urls)),

    (r'^map$', NamedRedirectView.as_view(name='maps:global')),
    (r'^', include(maps.site.urls_no_region)),
    (r'^tags$', NamedRedirectView.as_view(name='tags:list')),
    (r'^', include(tags.site.urls_no_region)),
    (r'^_redirect/', include(redirects.site.urls)),
    (r'^', include('search.urls_no_region')),
    (r'^', include('activity.urls_no_region')),
    (r'^', include('explore.urls')),

    # Region userpage -> global userpage redirect
    (r'^((?i)Users)/(?P<username>[^/]+?)/*(?P<rest>(/[^/_]+)|)$', GlobalUserpageRedirectView.as_view()),

    # Historical URL for dashboard:
    (r'^tools/dashboard/?$', NamedRedirectView.as_view(name='dashboard:main')),
    (r'^_tools/dashboard/', include(dashboard.site.urls)),

    (r'^(((?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',
コード例 #2
0
    # Comments
    (r"^_comment/(?P<region>[^/]+?)/", include(crap_comments.site.urls)),
    (r"^(?P<region>[^/]+?)/map$", NamedRedirectView.as_view(name="maps:global")),
    (r"^", include(maps.site.urls)),
    (r"^(?P<region>[^/]+?)/tags$", NamedRedirectView.as_view(name="tags:list")),
    (r"^", include(tags.site.urls)),
    (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