django-orchestra-test/orchestra/urls.py

36 lines
942 B
Python
Raw Normal View History

2014-05-08 16:59:35 +00:00
from __future__ import absolute_import
from django.contrib import admin
from django.conf import settings
from django.conf.urls import patterns, include, url
from . import api
admin.autodiscover()
api.autodiscover()
urlpatterns = patterns('',
# 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'
),
2014-07-29 20:10:37 +00:00
# TODO make this private
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}
)
2014-05-08 16:59:35 +00:00
)
if settings.DEBUG:
import debug_toolbar
urlpatterns += patterns('',
url(r'^__debug__/', include(debug_toolbar.urls)),
)