from django.conf import settings
from django.conf.urls.defaults import include, patterns, url
from django.contrib import admin

from newsroom import views as nr_views

# If we're in DEBUG, set a temp media directory at http://{{host}}/m/
if settings.DEBUG:
    urlpatterns = patterns(
        "",
        (
            r"^media/(?P<path>.*)$",
            'django.views.static.serve',
            {"document_root": settings.MEDIA_ROOT}
        ),
        (
            r'^static/(?P<path>.*)$',
            'django.views.static.serve',
            {'document_root': settings.STATIC_ROOT},
        )
    )
else:
    urlpatterns = patterns("",)


admin.autodiscover()

urlpatterns += patterns(
    "",
    url(r"^multimedia/", include("darkroom.urls")),
    url(r"^news/", include("newsroom.urls")),
    url(r"^classifieds/", include("classifieds.urls")),
    url(r"^documents/", include("documents.urls")),
    url(r"^$", nr_views.paper_index, name="nr-index"),
    (r"^", include("adzone.urls")),
)
