2014-05-08 16:59:35 +00:00
|
|
|
from django.contrib import admin
|
2015-05-19 13:27:04 +00:00
|
|
|
from django.conf.urls import include, url
|
2014-05-08 16:59:35 +00:00
|
|
|
|
|
|
|
from . import api
|
2015-05-04 14:19:58 +00:00
|
|
|
from .utils.apps import isinstalled
|
2014-05-08 16:59:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
admin.autodiscover()
|
|
|
|
api.autodiscover()
|
|
|
|
|
2015-05-04 14:19:58 +00:00
|
|
|
|
2015-05-19 13:27:04 +00:00
|
|
|
urlpatterns = [
|
2014-05-08 16:59:35 +00:00
|
|
|
# Admin
|
|
|
|
url(r'^admin/', include(admin.site.urls)),
|
|
|
|
url(r'^admin_tools/', include('admin_tools.urls')),
|
|
|
|
# REST API
|
|
|
|
url(r'^api/', include(api.router.urls)),
|
|
|
|
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
|
|
|
url(r'^api-token-auth/',
|
|
|
|
'rest_framework.authtoken.views.obtain_auth_token',
|
|
|
|
name='api-token-auth'
|
|
|
|
),
|
2015-06-02 12:59:49 +00:00
|
|
|
url(r'^media/(.+)/(.+)/(.+)/(.+)/(.+)$',
|
|
|
|
'orchestra.views.serve_private_media',
|
|
|
|
name='private-media'
|
|
|
|
),
|
2015-10-07 22:05:00 +00:00
|
|
|
url(r'search', 'orchestra.views.search', name='search'),
|
2015-05-19 13:27:04 +00:00
|
|
|
]
|
2014-05-08 16:59:35 +00:00
|
|
|
|
2014-10-07 13:08:59 +00:00
|
|
|
|
2015-05-04 14:19:58 +00:00
|
|
|
if isinstalled('debug_toolbar'):
|
2014-05-08 16:59:35 +00:00
|
|
|
import debug_toolbar
|
2015-05-19 13:27:04 +00:00
|
|
|
urlpatterns.append(
|
2014-05-08 16:59:35 +00:00
|
|
|
url(r'^__debug__/', include(debug_toolbar.urls)),
|
|
|
|
)
|