Ejemplo n.º 1
0
urlpatterns = auth_urlpatterns + [
    url(
        r'^admin/course_metadata/',
        include('course_discovery.apps.course_metadata.urls',
                namespace='admin_metadata')),
    url(r'^admin/core/',
        include('course_discovery.apps.core.urls', namespace='admin_core')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^api/', include('course_discovery.apps.api.urls', namespace='api')),
    # Use the same auth views for all logins, including those originating from the browseable API.
    url(r'^api-auth/', include(auth_urlpatterns, namespace='rest_framework')),
    url(r'^api-docs/', SwaggerSchemaView.as_view(), name='api_docs'),
    url(r'^auto_auth/$', core_views.AutoAuth.as_view(), name='auto_auth'),
    url(r'^health/$', core_views.health, name='health'),
    url('^$', QueryPreviewView.as_view()),
    url(r'^publisher/',
        include('course_discovery.apps.publisher.urls',
                namespace='publisher')),
    url(r'^journal/',
        include('course_discovery.apps.journal.urls', namespace='journal')),
    url(
        r'^publisher/comments/',
        include('course_discovery.apps.publisher_comments.urls',
                namespace='publisher_comments')),
    url(
        r'^language-tags/',
        include('course_discovery.apps.ietf_language_tags.urls',
                namespace='language_tags')),
    url(r'^comments/', include('django_comments.urls')),
    url(r'^i18n/', include('django.conf.urls.i18n')),
Ejemplo n.º 2
0
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""

import os

from auth_backends.urls import auth_urlpatterns
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin

from course_discovery.apps.core import views as core_views
from course_discovery.apps.course_metadata.views import QueryPreviewView

admin.autodiscover()

urlpatterns = auth_urlpatterns + [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^api/', include('course_discovery.apps.api.urls', namespace='api')),
    # Use the same auth views for all logins, including those originating from the browseable API.
    url(r'^api-auth/', include(auth_urlpatterns, namespace='rest_framework')),
    url(r'^api-docs/', include('rest_framework_swagger.urls')),
    url(r'^auto_auth/$', core_views.AutoAuth.as_view(), name='auto_auth'),
    url(r'^health/$', core_views.health, name='health'),
    url('^$', QueryPreviewView.as_view()),
]

if settings.DEBUG and os.environ.get('ENABLE_DJANGO_TOOLBAR', False):  # pragma: no cover
    import debug_toolbar  # pylint: disable=wrong-import-order,wrong-import-position,import-error

    urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls)))