# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2017-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later

from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.views import password_reset
from django.shortcuts import render
from django.views.generic import RedirectView


def index(request):
    """
    Static home page
    """
    return render(request, 'med/index.html', {})


urlpatterns = [
    url(r'^$', index, name='index'),

    # Include project routers
    url(r'^users/', include('users.urls', namespace='users')),
    url(r'^media/', include('media.urls', namespace='media')),
    url(r'^search/', include('search.urls', namespace='search')),
    url(r'^logs/', include('logs.urls', namespace='logs')),

    # Include Django Contrib and Core routers
    url(r'^accounts/password_reset/$',
        password_reset, name='admin_password_reset'),
    url(r'^i18n/', include('django.conf.urls.i18n')),
    url(r'^accounts/', include('django.contrib.auth.urls')),
    url(r'^accounts/profile/',
        RedirectView.as_view(pattern_name='index')),
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', admin.site.urls),
]
