51 lines
2.1 KiB
Python
51 lines
2.1 KiB
Python
"""blenderid URL Configuration
|
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
https://docs.djangoproject.com/en/1.11/topics/http/urls/
|
|
Examples:
|
|
Function views
|
|
1. Add an import: from my_app import views
|
|
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
|
|
Class-based views
|
|
1. Add an import: from other_app.views import Home
|
|
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
|
|
Including another URLconf
|
|
1. Import the include() function: from django.conf.urls import url, include
|
|
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
|
"""
|
|
from django.conf import settings
|
|
from django.conf.urls import url, include
|
|
from django.conf.urls.static import static
|
|
from django.contrib import admin
|
|
from django.contrib.flatpages import views as fp_views
|
|
from django.urls import path
|
|
|
|
import bid_main.views.errors as error_views
|
|
|
|
urlpatterns = [
|
|
url(r"^admin/doc/", include("django.contrib.admindocs.urls")),
|
|
url(r"^admin/", include("loginas.urls")),
|
|
url(r"^admin/", admin.site.urls),
|
|
url(r"", include("bid_addon_support.urls", namespace="addon_support")),
|
|
url(r"^oauth/", include("blenderid.oauth2_urls", namespace="oauth2_provider")),
|
|
url(r"^api/", include("bid_api.urls", namespace="bid_api")),
|
|
url(r"", include("bid_main.urls", namespace="bid_main")),
|
|
]
|
|
|
|
handler400 = error_views.ErrorView.as_view(template_name="errors/400.html", status=400)
|
|
handler403 = error_views.ErrorView.as_view(template_name="errors/403.html", status=403)
|
|
handler404 = error_views.ErrorView.as_view(template_name="errors/404.html", status=404)
|
|
handler500 = error_views.ErrorView.as_view(template_name="errors/500.html", status=500)
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += [
|
|
path("__debug__/", include('debug_toolbar.urls')),
|
|
]
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
|
|
|
urlpatterns += [
|
|
# Flatpages must be last!
|
|
url(r"^(?P<url>.*/?)", fp_views.flatpage),
|
|
]
|