"""project URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/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. Add an import:  from blog import urls as blog_urls
    2. Import the include() function: from django.conf.urls import url, include
    3. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
from django.views.generic.base import RedirectView

from api import urls as api_urls
from exp import urls as exp_urls
from osf_oauth2_adapter import views as osf_oauth2_adapter_views
from project import settings
from web import urls as web_urls

favicon_view = RedirectView.as_view(url="/static/favicon.ico", permanent=True)

urlpatterns = [
    path("favicon\.ico", favicon_view),
    path("admin/", admin.site.urls),
    path("api/", include((api_urls, "api"))),
    path(
        "accounts/social/login/cancelled/",
        osf_oauth2_adapter_views.login_errored_cancelled,
    ),
    path(
        "accounts/social/login/error/", osf_oauth2_adapter_views.login_errored_cancelled
    ),
    path("accounts/", include("allauth.urls")),
    path("exp/", include(exp_urls)),
    path("", include("django.contrib.auth.urls")),
    path("", include(web_urls)),
]

if settings.DEBUG:
    import debug_toolbar

    urlpatterns = (
        [path("__debug__/", include(debug_toolbar.urls))]
        + urlpatterns
        + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    )

"""project URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/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. Add an import:  from blog import urls as blog_urls
    2. Import the include() function: from django.conf.urls import url, include
    3. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
from django.views.generic.base import RedirectView

from api import urls as api_urls
from exp import urls as exp_urls
from osf_oauth2_adapter import views as osf_oauth2_adapter_views
from project import settings
from web import urls as web_urls

favicon_view = RedirectView.as_view(url="/static/favicon.ico", permanent=True)

urlpatterns = [
    path("favicon\.ico", favicon_view),
    path("__CTRL__/", admin.site.urls),
    path("api/", include((api_urls, "api"))),
    path(
        "accounts/social/login/cancelled/",
        osf_oauth2_adapter_views.login_errored_cancelled,
    ),
    path(
        "accounts/social/login/error/", osf_oauth2_adapter_views.login_errored_cancelled
    ),
    path("accounts/", include("allauth.urls")),
    path("exp/", include(exp_urls)),
    path("", include("django.contrib.auth.urls")),
    path("", include(web_urls)),
]

if settings.DEBUG:
    import debug_toolbar

    urlpatterns = (
        [path("__debug__/", include(debug_toolbar.urls))]
        + urlpatterns
        + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    )

change admin panel URL to something non-obvious