1
0
Fork 0
IdreXyz/idre/urls.py

26 lines
717 B
Python
Raw Normal View History

2016-02-01 17:52:43 +01:00
from django.conf.urls import include, url
2015-03-14 22:38:12 +01:00
from django.conf.urls.static import static
from django.contrib import admin
2016-02-01 17:52:43 +01:00
import idre.settings
2015-03-14 22:38:12 +01:00
import label.views
admin.autodiscover()
2016-02-01 17:52:43 +01:00
urlpatterns = [
2015-03-14 22:38:12 +01:00
url(r"^$", label.views.home, name = "home"),
2016-02-01 17:52:43 +01:00
url(r"^artists/$", label.views.artists, name = "artists"),
url(r"^artists/(?P<slug>\S+)$", label.views.artist, name = "artist"),
url(r"^releases/$", label.views.releases, name = "releases"),
url(r"^releases/(?P<tag>\S+)$", label.views.release, name = "release"),
2015-03-14 22:38:12 +01:00
url(r"^admin/", include(admin.site.urls)),
2016-02-01 17:52:43 +01:00
]
2015-03-14 22:38:12 +01:00
2016-02-01 17:52:43 +01:00
if idre.settings.DEBUG:
2015-03-14 22:38:12 +01:00
urlpatterns += static(
2016-02-01 17:52:43 +01:00
idre.settings.MEDIA_URL,
document_root = idre.settings.MEDIA_ROOT
)